export class CustomError extends Error { constructor ( public readonly message , public readonly code , public readonly detail ? ) { super ( message ) ; } } export class RedirectError extends CustomError { constructor ( code , detail ) { super ( "redirect" , code , detail ) ; } } export class UnauthorizedError extends CustomError { constructor ( ) { super ( "请登录" , "401" ) ; } }