Compare commits

...
2 Commits
Author SHA1 Message Date
Gabriel Amorim 43372b5a0f FIX: Better error handling on input creation
Merge pull request #102 from dadosfera/fix/error-handling
2022-06-10 16:05:29 -03:00
Gabriel Rosa 0ac2dd2de7 Better error handling on input creation 2022-06-10 15:57:19 -03:00
+5 -2
View File
@@ -1,4 +1,4 @@
import { Inject, OnModuleInit } from '@nestjs/common';
import { HttpException, Inject, OnModuleInit } from '@nestjs/common';
import { ClientGrpc, Payload } from '@nestjs/microservices';
import {
PipelineServicesNames,
@@ -49,7 +49,10 @@ export class PipelinesClientService implements OnModuleInit {
})
.then((res) => res)
.catch((err) => {
throw new Error(err);
if (err.details == 'Invalid Request') {
throw new HttpException(err.details, 400);
}
throw new HttpException(err.details, 500);
});
return createPipelineResponse;