import { isNullOrUndefined } from 'util'; import { ApiClient } from './api.client'; import { ClientOptions } from './api.client.factory'; export class GssApiClient extends ApiClient { constructor(protected options: ClientOptions) { super( options.baseUrl, options.headerProcessor, (resp) => { if (resp.status === 204) { return null; } const { returnCode, errorString, result } = resp.data || ({} as any); if (returnCode == 0) { return result; } throw new Error(`${errorString}`); // throw new Error(`returnCode = ${returnCode}, ${errorString}`); }, options.errorHandler ); } } export interface GssApiResponse { returnCode: number; errorString: string; result: any; }