{"record":{"id":"bec4c18b4f976552","repo":"siyuan-note/siyuan","slug":"request-bazaar-package-rating-failed","errorCode":null,"errorMessage":"request bazaar package rating failed","messagePattern":"request bazaar package rating failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/bazaar_rating.go","lineNumber":364,"sourceCode":"\t\tlogging.LogWarnf(\"request bazaar package rating failed: %s\", err)\n\t\treturn ErrFailedToConnectCloudServer\n\t}\n\tif http.StatusUnauthorized == resp.StatusCode {\n\t\tinvalidUser()\n\t\treturn errors.New(Conf.Language(31))\n\t}\n\tif http.StatusTooManyRequests == resp.StatusCode {\n\t\treturn ErrBazaarRatingRateLimited\n\t}\n\tif http.StatusOK != resp.StatusCode {\n\t\tlogging.LogWarnf(\"request bazaar package rating failed: %d\", resp.StatusCode)\n\t\treturn ErrFailedToConnectCloudServer\n\t}\n\tif 0 != result.Code {\n\t\tif \"\" != result.Msg {\n\t\t\treturn errors.New(result.Msg)\n\t\t}\n\t\treturn errors.New(\"request bazaar package rating failed\")\n\t}\n\t*data = result.Data\n\treturn nil\n}\n\nfunc isValidBazaarPackageType(pkgType string) bool {\n\tswitch pkgType {\n\tcase \"plugins\", \"widgets\", \"icons\", \"templates\", \"themes\":\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n","sourceCodeStart":346,"sourceCodeEnd":378,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/bazaar_rating.go#L346-L378","documentation":"When the cloud envelope has result.Code != 0 but result.Msg is empty, requestBazaarPackageRating falls back to the generic message 'request bazaar package rating failed'. It means the cloud server reported an error without a human-readable explanation.","triggerScenarios":"Same as any result.Code != 0 cloud response (GetBazaarPackageRating / SetBazaarPackageRating), but the server omitted the Msg field in its JSON response.","commonSituations":"Older or misconfigured bazaar server versions that return bare error codes, proxy/gateway stripping the response body fields, or undocumented server error codes.","solutions":["Inspect result.Code by instrumenting or checking kernel logs (logging.LogWarnf lines) for the underlying status","Retry the request — some transient cloud errors return empty messages","Verify you are on a current kernel version compatible with the current bazaar API","Report/inspect the request server-side; without Msg the client cannot distinguish the failure cause"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await api.getBazaarPackageRating(pkg);\n} catch (e) {\n  if (isGenericRatingFailure(e)) { await delay(2000); retryOnce(); }\n  else { throw e; }\n}","preventionTips":["Retry transient-looking opaque cloud failures with backoff","Log full request context (status, code) since the message carries no detail","Check bazaar server status before assuming a client bug"],"tags":["cloud","api","bazaar","opaque-error"],"backgroundTag":"api-error-response","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}