Now throwing errors even faster

ref #13
This commit is contained in:
2020-12-05 12:18:24 +01:00
parent 45675b0699
commit 179add80f4
3 changed files with 3 additions and 8 deletions

View File

@@ -84,6 +84,7 @@ export class RunnerController {
@ResponseSchema(RunnerNotFoundError, { statusCode: 404 })
@OpenAPI({ description: 'Delete a specified runner (if it exists).' })
async remove(@EntityFromParam('id') runner: Runner, @QueryParam("force") force: boolean) {
if (!runner) { throw new RunnerNotFoundError(); }
const responseRunner = await this.runnerRepository.findOne(runner, { relations: ['scans', 'group'] });
if (!runner) {