Skip to content

Commit

Permalink
error response upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaog committed Apr 23, 2024
1 parent 473be38 commit 9bd2c1e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/controllers/execution.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export async function startExecution(req: Request<{},any,StartExecutionBody>, re
platform: firstNode.platform
})
} catch(err) {
next(err);
res.status(500).send(err);
}


Expand Down Expand Up @@ -105,7 +105,7 @@ export async function getActualNode(req: Request<{},any, GetNextExerciseV2Body>,

return res.status(200).json(actualNode.node);
}catch(err) {
next(err);
res.status(500).send(err);
}
}

Expand Down Expand Up @@ -139,7 +139,7 @@ export async function getNextExercisev2(req: Request<{},any, GetNextExerciseV2Bo

return res.status(200).json(firstNode);
}catch(err) {
next(err);
res.status(500).send(err);
}
}

Expand Down Expand Up @@ -176,7 +176,7 @@ export async function getInitialExercise(req: Request<{}, any, GetInitialExercis

return res.status(200).json(actualNode);
}catch(err) {
next(err);
res.status(500).send(err);
}
}
type GetNextExerciseBody = {
Expand Down Expand Up @@ -222,6 +222,6 @@ export async function getNextExercise(req: Request<{}, any, GetNextExerciseBody>

return res.status(200).json(actualNode);
}catch(err) {
next(err);
res.status(500).send(err);
}
}
16 changes: 8 additions & 8 deletions src/controllers/flows.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export async function getFlowById(req: Request, res: Response<Document<unknown,
return res.status(404).send();
}
return res.status(200).send(flow);
} catch (err) {
return next(err);
} catch (err: any) {
return res.status(500).send(err);
}

}
Expand Down Expand Up @@ -122,8 +122,8 @@ export async function getFlowList(req: Request, res: Response, next : NextFuncti
return res.status(404).send();
}
return res.status(200).send(flows);
} catch (err) {
return next(err);
} catch (err: any) {
return res.status(500).send(err);
}

}
Expand Down Expand Up @@ -229,7 +229,7 @@ export async function updateFlow(req: Request, res: Response, next: NextFunction

return res.status(200).send(flow);
} catch (err) {
return next(err);
return res.status(500).send(err);
}

}
Expand All @@ -249,7 +249,7 @@ export async function publishFlow(req: Request, res: Response, next : NextFuncti

return res.status(200).send(flows);
} catch (err) {
return next(err);
return res.status(500).send(err);
}

}
Expand All @@ -263,7 +263,7 @@ export async function createFlow(req: Request, res: Response, next : NextFunctio
return res.status(200).send(flow);
} catch (err) {
console.log(err);
return next(err);
return res.status(500).send(err);
}
}

Expand All @@ -285,6 +285,6 @@ export async function createFlowJson(req: Request, res: Response, next : NextFun
return res.status(200).send({id: newFlow?._id});
} catch (err) {
console.log(err);
return next(err);
return res.status(500).send(err);
}
}

0 comments on commit 9bd2c1e

Please sign in to comment.