siyuan-note/siyuan · error
result.Msg
Error message
result.Msg
What it means
The cloud API envelope carries a non-zero Code with a human-readable Msg on business failures; requestBazaarPackageRating surfaces result.Msg verbatim as the error. The text is produced server-side, not locally.
Solutions
- Read the returned message — it states the server-side cause directly
- Update SiYuan to the latest version to match current server API expectations
- If the message indicates permissions, verify the cloud account state
Defensive patterns
Strategy: try-catch
Validate before calling
// ensure client and payload match current server API expectations
await checkKernelVersionAtLeast("3.1"); // server API may reject old clients Try / catch
try {
await api.setBazaarPackageRating(pkgType, pkg, rating);
} catch (e) {
if (!isLocalValidationError(e) && e.serverMessage) {
showToast(e.serverMessage); // server-supplied result.Msg explains the cause
} else throw e;
} Prevention
- Surface result.Msg text to users instead of swallowing it
- Keep SiYuan updated to stay in sync with server business rules
- Avoid duplicate submissions that server rules may reject
When it happens
Trigger: Server-side validation or business-rule rejection during a rating request: e.g. rate/permission rules, package not found server-side, or invalid payload accepted by HTTP but rejected by the API logic.
Common situations: Submitting the same rating twice where the server forbids it; account restrictions; server version newer than the client sending unexpected fields.
Related errors
- cloud server result message (result.Msg)
- request bazaar package rating failed
- Conf.Language(31)
- Failed to obtain cloud info
- Field [ ] must not be empty
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/b6822ef69aeef15a.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/bazaar_rating.go:394
invalidUser()
return errors.New(Conf.Language(31))
}
if http.StatusTooManyRequests == resp.StatusCode {
return ErrBazaarRatingRateLimited
}
if http.StatusOK != resp.StatusCode {
if body, readErr := resp.ToBytes(); nil == readErr {
_ = json.Unmarshal(body, &errorResult)
}
if http.StatusServiceUnavailable == resp.StatusCode && "bazaarPackagePending" == errorResult.Data.ErrorCode {
return ErrBazaarPackagePending
}
logging.LogWarnf("request bazaar package rating [%s] failed: HTTP %d", body["packageName"], resp.StatusCode)
return fmt.Errorf("request bazaar package rating failed: HTTP %d (%s)", resp.StatusCode, http.StatusText(resp.StatusCode))
}
if 0 != result.Code {
if "" != result.Msg {
return errors.New(result.Msg)
}
return errors.New("request bazaar package rating failed")
}
*data = result.Data
return nil
}
func isValidBazaarPackageType(pkgType string) bool {
switch pkgType {
case "plugins", "widgets", "icons", "templates", "themes":
return true
default:
return false
}
}
View on GitHub (pinned to 9f775e8a12)