Skip to content

zentao-api / ERRORS

Variable: ERRORS ​

const ERRORS: object

SDK 已知错误码到默认消息的映射表。

每条消息允许带 {key} 占位符,由 ZentaoError 构造时使用 replacements 进行字面量替换。此对象使用 as const,可直接作为类型来源约束错误码。

Type Declaration ​

NameTypeDefault value
E_ABORTED"Request was aborted."'Request was aborted.'
E_API_FAILED"ZenTao API returned failure: {message}"'ZenTao API returned failure: {message}'
E_HTTP_ERROR"HTTP request failed: {status} {statusText}"'HTTP request failed: {status} {statusText}'
E_INDETERMINATE_ACTION_METHOD"Cannot infer HTTP method for action "{action}" from type "{type}"; specify "method" explicitly."'Cannot infer HTTP method for action "{action}" from type "{type}"; specify "method" explicitly.'
E_INDETERMINATE_ACTION_RESULT_TYPE"Cannot infer result type for action "{action}" from type "{type}"; specify "resultType" explicitly."'Cannot infer result type for action "{action}" from type "{type}"; specify "resultType" explicitly.'
E_INSECURE_BROWSER"The insecure option is only supported in Node.js runtimes."'The insecure option is only supported in Node.js runtimes.'
E_INVALID_ACTION"Unknown action: {module}-{action}"'Unknown action: {module}-{action}'
E_INVALID_ACTION_DEFINITION"Invalid module action definition."'Invalid module action definition.'
E_INVALID_BASE_URL"Invalid ZenTao baseUrl."'Invalid ZenTao baseUrl.'
E_INVALID_MODULE"Unknown module: {module}"'Unknown module: {module}'
E_INVALID_MODULE_DEFINITION"Invalid module definition."'Invalid module definition.'
E_INVALID_PARAM"Invalid value for parameter {param}: {value}"'Invalid value for parameter {param}: {value}'
E_INVALID_PROFILE"Invalid ZenTao profile."'Invalid ZenTao profile.'
E_INVALID_REQUEST_NAME"Request name must use the form "moduleName", "moduleName/methodName", or "moduleName/<objectID>"."'Request name must use the form "moduleName", "moduleName/methodName", or "moduleName/<objectID>".'
E_INVALID_UPLOAD_SOURCE"Invalid upload source for field: {field}"'Invalid upload source for field: {field}'
E_INVALID_ZENTAO_CONFIG"ZenTao configuration must be an object with a non-empty version."'ZenTao configuration must be an object with a non-empty version.'
E_INVALID_ZENTAO_VERSION"Invalid ZenTao version: {version}"'Invalid ZenTao version: {version}'
E_LOGIN_FAILED"ZenTao login failed."'ZenTao login failed.'
E_MISSING_PARAM"Missing required parameter: {param}"'Missing required parameter: {param}'
E_NETWORK_ERROR"Network request failed: {message}"'Network request failed: {message}'
E_NO_GLOBAL_CLIENT"No global client configured. Call ZentaoClient.init() or pass options.client."'No global client configured. Call ZentaoClient.init() or pass options.client.'
E_NO_PROFILE"No ZenTao profile is configured."'No ZenTao profile is configured.'
E_PROFILE_NOT_FOUND"ZenTao profile not found: {profileKey}"'ZenTao profile not found: {profileKey}'
E_PROFILE_STORAGE_INVALID"ZenTao profile storage must be a JSON object with a profiles array and an optional currentProfile string."'ZenTao profile storage must be a JSON object with a profiles array and an optional currentProfile string.'
E_PROFILE_STORAGE_UNAVAILABLE"ZenTao profile storage is unavailable in this runtime."'ZenTao profile storage is unavailable in this runtime.'
E_TIMEOUT"Request timed out."'Request timed out.'
E_UNSUPPORTED_ZENTAO_VERSION"Action {action} does not support ZenTao {version}; minimum versions: {minVersion}"'Action {action} does not support ZenTao {version}; minimum versions: {minVersion}'
E_UPLOAD_FILE_NOT_FOUND"Upload file not found: {path}"'Upload file not found: {path}'
E_UPLOAD_FILE_READ_FAILED"Failed to read upload file: {path}"'Failed to read upload file: {path}'
E_UPLOAD_FILE_TOO_LARGE"Upload file is {size} bytes and exceeds the {limit} byte limit."'Upload file is {size} bytes and exceeds the {limit} byte limit.'
E_UPLOAD_PATH_UNSUPPORTED"Local file paths are not supported in browser runtimes. Pass a File or Blob instead."'Local file paths are not supported in browser runtimes. Pass a File or Blob instead.'

Released under the MIT License.