Compare commits

...
3 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
Arthur Simas d89573bc79 FIX: creating swap file 2022-06-06 17:35:26 -03:00
3 changed files with 22 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
container_commands:
01setup_swap:
command: "bash .ebextensions/setup_swap.sh"
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
SWAPFILE=/var/swapfile
SWAP_MEGABYTES=1024
if [ -f $SWAPFILE ]; then
echo "Swapfile $SWAPFILE found, assuming already setup"
exit;
fi
/bin/dd if=/dev/zero of=$SWAPFILE bs=1M count=$SWAP_MEGABYTES
/bin/chmod 600 $SWAPFILE
/sbin/mkswap $SWAPFILE
/sbin/swapon $SWAPFILE
+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;