From 97daba5c580822d1e3b9959c72add90c7e213bf5 Mon Sep 17 00:00:00 2001 From: Bogdan Ilchyshyn Date: Mon, 4 Jul 2022 17:06:34 +1000 Subject: [PATCH] fixing error handler interceptor (#12761) --- .../src/main/resources/typescript-fetch/runtime.mustache | 2 +- .../petstore/typescript-fetch/builds/default-v3.0/runtime.ts | 2 +- .../client/petstore/typescript-fetch/builds/default/runtime.ts | 2 +- samples/client/petstore/typescript-fetch/builds/enum/runtime.ts | 2 +- .../petstore/typescript-fetch/builds/es6-target/src/runtime.ts | 2 +- .../typescript-fetch/builds/multiple-parameters/runtime.ts | 2 +- .../builds/prefix-parameter-interfaces/src/runtime.ts | 2 +- .../typescript-fetch/builds/sagas-and-records/src/runtime.ts | 2 +- .../petstore/typescript-fetch/builds/with-interfaces/runtime.ts | 2 +- .../typescript-fetch/builds/with-npm-version/src/runtime.ts | 2 +- .../typescript-fetch/builds/with-string-enums/runtime.ts | 2 +- .../builds/without-runtime-checks/src/runtime.ts | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache index d4644d543ff..a72fe562f40 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache @@ -181,7 +181,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts index 01a6b3b2bd4..699a8bc46f6 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts @@ -192,7 +192,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } } diff --git a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts index add595fb797..ec8bf8b7c56 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts @@ -192,7 +192,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } } diff --git a/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts b/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts index 99d8d846c83..c3bbbbc6cfb 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts @@ -192,7 +192,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts index add595fb797..ec8bf8b7c56 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts @@ -192,7 +192,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts index add595fb797..ec8bf8b7c56 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts @@ -192,7 +192,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts index add595fb797..ec8bf8b7c56 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts @@ -192,7 +192,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts index add595fb797..ec8bf8b7c56 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts @@ -192,7 +192,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts index add595fb797..ec8bf8b7c56 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts @@ -192,7 +192,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts index add595fb797..ec8bf8b7c56 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts @@ -192,7 +192,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts index 99d8d846c83..c3bbbbc6cfb 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts @@ -192,7 +192,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } } diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts index 55c164497f8..18b00f89850 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts @@ -192,7 +192,7 @@ export class BaseAPI { }) || response; } } - if (response !== undefined) { + if (response === undefined) { throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); } }