export class SdkError extends Error { readonly code: string; readonly name: string; readonly msg: string; static create(code: string, name: string, msg: string): SdkError { return new SdkError(code, name, msg); } static createDefault(name: string, msg: string): SdkError { return new SdkError('-1', name, msg); } protected constructor(code: string, name: string, msg: string) { super(); this.code = code; this.name = name; this.msg = msg; } } export class AuthorizeError extends SdkError { static infoError(): AuthorizeError { return new AuthorizeError('-101', 'AuthorizeInfoError', '授权信息异常'); } static noAuthorize(name: string): AuthorizeError { return new AuthorizeError('-102', 'NoAuthorize', '模块授权缺失(' + name + ')'); } }