Skip to content

Commit be5142a

Browse files
Stefan SchubertStefan Schubert
authored andcommitted
add second parameter for identification of error
source
1 parent 9be574c commit be5142a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/mustache/api.service.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ export class {{classname}} {
328328
}
329329
);
330330
if(typeof this.configuration.errorHandler === 'function') {
331-
return handle.pipe(catchError(err => this.configuration.errorHandler(err)));
331+
return handle.pipe(catchError(err => this.configuration.errorHandler(err, '{{operationIdOriginal}}')));
332332
}
333333
return handle;
334334
{{/useHttpClient}}
@@ -357,7 +357,7 @@ export class {{classname}} {
357357

358358
const handle = this.http.request(`${this.configuration.basePath}{{{path}}}`, requestOptions);
359359
if(typeof this.configuration.errorHandler === 'function') {
360-
return handle.catch(err => this.configuration.errorHandler(err));
360+
return handle.catch(err => this.configuration.errorHandler(err, '{{operationIdOriginal}}'));
361361
}
362362
return handle;
363363
{{/useHttpClient}}

src/mustache/configuration.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
{{! Riesaer Str. 5, 01129 Dresden }}
33
{{! All rights reserved. }}
44
{{^useRxJS6}}
5-
import { Observable } from 'rxjs/Observable';
5+
import { Observable } from 'rxjs/Observable';
66
{{/useRxJS6}}
77
{{#useRxJS6}}
8-
import { Observable } from 'rxjs';
8+
import { Observable } from 'rxjs';
99
{{/useRxJS6}}
1010

1111
export interface ConfigurationParameters {
1212
apiKeys?: {[ key: string ]: string};
1313
username?: string;
1414
password?: string;
1515
accessToken?: string | (() => string);
16-
errorHandler?: (err: any) => Observable<never>;
16+
errorHandler?: (err: any, operationName: string) => Observable<never>;
1717
basePath?: string;
1818
withCredentials?: boolean;
1919
}
@@ -23,7 +23,7 @@ export class Configuration {
2323
username?: string;
2424
password?: string;
2525
accessToken?: string | (() => string);
26-
errorHandler?: (err: any) => Observable<never>;
26+
errorHandler?: (err: any, operationName: string) => Observable<never>;
2727
basePath?: string;
2828
withCredentials?: boolean;
2929

0 commit comments

Comments
 (0)