{"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":396,"sourceCode":"\t}\n\tif http.StatusTooManyRequests == resp.StatusCode {\n\t\treturn ErrBazaarRatingRateLimited\n\t}\n\tif http.StatusOK != resp.StatusCode {\n\t\tif body, readErr := resp.ToBytes(); nil == readErr {\n\t\t\t_ = json.Unmarshal(body, &errorResult)\n\t\t}\n\t\tif http.StatusServiceUnavailable == resp.StatusCode && \"bazaarPackagePending\" == errorResult.Data.ErrorCode {\n\t\t\treturn ErrBazaarPackagePending\n\t\t}\n\t\tlogging.LogWarnf(\"request bazaar package rating [%s] failed: HTTP %d\", body[\"packageName\"], resp.StatusCode)\n\t\treturn fmt.Errorf(\"request bazaar package rating failed: HTTP %d (%s)\", resp.StatusCode, http.StatusText(resp.StatusCode))\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":378,"sourceCodeEnd":410,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/bazaar_rating.go#L378-L410","documentation":"Fallback branch of the cloud envelope handling: result.Code is non-zero but the server supplied no Msg, so a generic \"request bazaar package rating failed\" error is returned instead of a specific message.","triggerScenarios":"Same business-failure conditions as the result.Msg branch (error 1077), but the server response omits the message field — older server versions, proxies truncating JSON, or internal errors without messages.","commonSituations":"Mismatched cloud server/client versions; intermediary proxies altering response bodies; server bugs returning error codes without text.","solutions":["Retry and check kernel logs for the logged warning with details","Update SiYuan client and verify cloud service health","Capture the full response (e.g. via proxy/logs) if reporting the issue"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await api.getBazaarPackageRating(pkgType, pkg);\n} catch (e) {\n  if (String(e.message) === \"request bazaar package rating failed\") {\n    // generic failure: log context, retry with backoff, then report\n    await sleep(retryDelay);\n  } else throw e;\n}","preventionTips":["Keep client/server versions aligned so error envelopes include messages","Avoid proxies that truncate or rewrite JSON bodies","Include request context in logs for bug reports"],"tags":["api","cloud","bazaar"],"backgroundTag":"api-error-response","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}