import { DetailsError } from './DetailsError' ; import type { ServerError } from './sdk' ; export enum ServerErrorType { 'QUOTE_EXCEEDED' = 'quotaExceeded' } export class ServerInternalError extends DetailsError implements ServerError { readonly errorCode ? : string ; readonly errorType ? : ServerErrorType ; readonly stackTrace ? : string ; readonly causedBy ? : ServerError ; constructor ( error ) { super ( error . message ) ; this . name = 'Server Internal Error' ; this . errorCode = error . errorCode ; this . errorType = error . errorType as ServerErrorType ; this . stackTrace = error . stackTrace ; this . causedBy = error . causedBy ; } hasDetails ( ) { return this . stackTrace !== undefined && this . stackTrace . length > 0 ; } }