@node-c/api-http 1.0.0-alpha11 → 1.0.0-alpha12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.HTTPErrorInterceptor = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const core_1 = require("@node-c/core");
|
|
12
|
+
const rxjs_1 = require("rxjs");
|
|
12
13
|
const operators_1 = require("rxjs/operators");
|
|
13
14
|
const common_errors_1 = require("../common/definitions/common.errors");
|
|
14
15
|
let HTTPErrorInterceptor = class HTTPErrorInterceptor {
|
|
@@ -55,7 +56,7 @@ let HTTPErrorInterceptor = class HTTPErrorInterceptor {
|
|
|
55
56
|
.getResponse()
|
|
56
57
|
.status(status)
|
|
57
58
|
.json({ error: message instanceof Array ? message.join('\n') : message });
|
|
58
|
-
return
|
|
59
|
+
return new rxjs_1.Observable();
|
|
59
60
|
}));
|
|
60
61
|
}
|
|
61
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.interceptors.error.js","sourceRoot":"","sources":["../../src/interceptors/http.interceptors.error.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4F;AAE5F,uCAAgD;
|
|
1
|
+
{"version":3,"file":"http.interceptors.error.js","sourceRoot":"","sources":["../../src/interceptors/http.interceptors.error.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4F;AAE5F,uCAAgD;AAEhD,+BAAkC;AAClC,8CAA4C;AAE5C,uEAAkE;AAG3D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,SAAS,CAAC,OAAyB,EAAE,IAAiB;QACpD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CACvB,IAAA,sBAAU,EAAC,KAAK,CAAC,EAAE;YACjB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,IAAI,O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E,KAAK,EAAE,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YAC5E,OAAO,IAAI,iBAAU,EAAE,CAAC;QAC1B,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAA;AA5CY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;GACA,oBAAoB,CA4ChC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-c/api-http",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-alpha12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@types/express": "^5.0.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@node-c/core": "^1.0.0-
|
|
27
|
-
"@node-c/domain-iam": "^1.0.0-
|
|
26
|
+
"@node-c/core": "^1.0.0-alpha12",
|
|
27
|
+
"@node-c/domain-iam": "^1.0.0-alpha12"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -43,16 +43,12 @@ export class HTTPErrorInterceptor implements NestInterceptor {
|
|
|
43
43
|
message = error.message;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
// TODO: fix this, as we're still getting error 500 when throwing the exception
|
|
47
46
|
context
|
|
48
47
|
.switchToHttp()
|
|
49
48
|
.getResponse()
|
|
50
49
|
.status(status)
|
|
51
50
|
.json({ error: message instanceof Array ? message.join('\n') : message });
|
|
52
|
-
return
|
|
53
|
-
// return throwError(
|
|
54
|
-
// () => new HttpException({ error: message instanceof Array ? message.join('\n') : message }, status)
|
|
55
|
-
// );
|
|
51
|
+
return new Observable();
|
|
56
52
|
})
|
|
57
53
|
);
|
|
58
54
|
}
|