{"record":{"id":"c2fb5148ac5d6aa8","repo":"AlistGo/alist","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"exception","errorClass":"errNotImplemented","httpStatus":null,"severity":"warning","filePath":"pkg/aria2/rpc/client.go","lineNumber":28,"sourceCode":")\n\n// Option is a container for specifying Call parameters and returning results\ntype Option map[string]interface{}\n\ntype Client interface {\n\tProtocol\n\tClose() error\n}\n\ntype client struct {\n\tcaller\n\turl   *url.URL\n\ttoken string\n}\n\nvar (\n\terrInvalidParameter = errors.New(\"invalid parameter\")\n\terrNotImplemented   = errors.New(\"not implemented\")\n\terrConnTimeout      = errors.New(\"connect to aria2 daemon timeout\")\n)\n\n// New returns an instance of Client\nfunc New(ctx context.Context, uri string, token string, timeout time.Duration, notifier Notifier) (Client, error) {\n\tu, err := url.Parse(uri)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar caller caller\n\tswitch u.Scheme {\n\tcase \"http\", \"https\":\n\t\tcaller = newHTTPCaller(ctx, u, timeout, notifier)\n\tcase \"ws\", \"wss\":\n\t\tcaller, err = newWebsocketCaller(ctx, u.String(), timeout, notifier)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/pkg/aria2/rpc/client.go#L10-L46","documentation":"Sentinel error errNotImplemented in the aria2 RPC client, reserved for operations the client does not support (as opposed to the daemon). It signals an interface capability gap: the method exists on the Client interface shape but this client build returns the sentinel instead of performing a call.","triggerScenarios":"Invoking a client method whose concrete implementation is intentionally unimplemented in this build — e.g. changeGlobalOption/download-only helpers depending on fork version. Because the sentinel is defined at client.go:28 and referenced only there, some builds return it for unsupported URI schemes or notification paths.","commonSituations":"Code written against a newer/older rpc.Client API than the vendored version; feature-gated builds where BitTorrent or peer-list methods are stubbed out.","solutions":["Check the vendored rpc package for which methods return errNotImplemented and avoid them","Upgrade or align the vendored aria2 rpc package with the API version your code targets","Use ListMethods on the daemon to confirm the operation is supported server-side, then call it via generic Call"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func supportsCall(c rpc.Client, probe string) bool {\n    // consult the vendored package docs/source for stubbed methods\n    switch probe {\n    case \"ChangeGlobalOption\", \"GetFiles\":\n        return true\n    }\n    return false\n}","tryCatchPattern":"err := c.SomeMethod()\nif err != nil && strings.Contains(err.Error(), \"not implemented\") {\n    // fall back to a generic Call with the method name\n    err = c.Call(\"aria2.someMethod\", params, &reply)\n}","preventionTips":["Pin the vendored rpc package version and code against its actual API surface","Use ListMethods to confirm daemon-side support before calling","Isolate version-specific calls behind small wrappers so gaps are localized"],"tags":["aria2","rpc","not-implemented"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}