py-uni
Version:
py-uni
47 lines (41 loc) • 868 B
text/typescript
// @ts-ignore
import {Observable, of} from 'rxjs';
export class ErrorHandle {
listen<T>(operation = 'operation') {
return (error: any): Observable<ErrorResponse> => {
return of(new ErrorResponse({error_response: {Code: 'ts404', Msg: error.message}}));
};
}
}
export class ErrorResponse {
errorResponse: {
Code?: string;
Msg?: string;
Stacks?:string;
};
constructor(opts: {
error_response?: {
Code?: string;
Msg?: string;
Stacks?:string;
}
} = {}) {
// @ts-ignore
this.errorResponse = opts.error_response;
}
}
export class JavaErrorResponse {
errorResponse: {
errCode?: string;
errMsg?: string;
};
constructor(opts: {
error_response?: {
errCode?: string;
errMsg?: string;
}
} = {}) {
// @ts-ignore
this.errorResponse = opts.error_response;
}
}