Skip to content

Commit ec22134

Browse files
debug: t is not a function
1 parent 1a6f735 commit ec22134

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@povio/openapi-codegen-cli",
3-
"version": "2.0.2-rc.1",
3+
"version": "2.0.2-rc.2",
44
"main": "./dist/index.js",
55
"types": "./dist/index.d.ts",
66
"exports": {

src/lib/rest/error-handling.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class ErrorHandler<CodeT extends string> {
9898
const unknownError: ErrorEntry<ICodeT> = {
9999
code: "UNKNOWN_ERROR",
100100
condition: () => true,
101-
getMessage: (e) => {
101+
getMessage: (_, e) => {
102102
if (axios.isAxiosError(e) && e.response?.data?.code) {
103103
return this.t("openapi.sharedErrors.unknownErrorWithCode", {
104104
code: e.response.data.code,
@@ -127,6 +127,9 @@ export class ErrorHandler<CodeT extends string> {
127127
const code = RestUtils.extractServerResponseCode(error);
128128
const errorEntry = this.entries.find((entry) => this.matchesEntry(error, entry, code))!;
129129

130+
// eslint-disable-next-line no-console
131+
console.log("[ErrorHandler] this.t:", this.t, "typeof:", typeof this.t);
132+
130133
const serverMessage = RestUtils.extractServerErrorMessage(error);
131134
const exception = new ApplicationException(errorEntry.getMessage(this.t, error), errorEntry.code, serverMessage);
132135

0 commit comments

Comments
 (0)