refactor: Improve error logging/reporting for cli (#4691)

* use response error classes instead of `ResponseError` everywhere

* improve error logging in dev mode or when telemetry is disabled
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2022-11-22 14:00:36 +01:00
committed by GitHub
parent 5364e7fc92
commit 0b754a4f85
29 changed files with 253 additions and 393 deletions

View File

@@ -172,10 +172,8 @@ executionsController.get(
userId: req.user.id,
filter: req.query.filter,
});
throw new ResponseHelper.ResponseError(
throw new ResponseHelper.InternalServerError(
`Parameter "filter" contained invalid JSON string.`,
500,
500,
);
}
}
@@ -363,10 +361,8 @@ executionsController.post(
executionId,
},
);
throw new ResponseHelper.ResponseError(
throw new ResponseHelper.NotFoundError(
`The execution with the ID "${executionId}" does not exist.`,
404,
404,
);
}
@@ -485,10 +481,8 @@ executionsController.post(
requestFilters = requestFiltersRaw as IGetExecutionsQueryFilter;
}
} catch (error) {
throw new ResponseHelper.ResponseError(
throw new ResponseHelper.InternalServerError(
`Parameter "filter" contained invalid JSON string.`,
500,
500,
);
}
}