Skip to content

Commit

Permalink
Change response to packageVersionNotFound from badRequest in case of
Browse files Browse the repository at this point in the history
parsing issues or missing artifacts at the repo. This normalizes the API somewhat.
  • Loading branch information
MagielBruntink committed Dec 1, 2022
1 parent a48b08c commit 240a5a3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ ResponseEntity<String> getPackageVersion(@PathVariable("pkg") String packageName
return Responses.ok(result);
}
catch (IllegalArgumentException e) {
return Responses.badRequest();
return Responses.packageVersionNotFound();
}
}

Expand All @@ -103,7 +103,7 @@ ResponseEntity<String> getPackageMetadata(@PathVariable("pkg") String packageNam
return Responses.ok(result);
}
catch (IllegalArgumentException e) {
return Responses.badRequest();
return Responses.packageVersionNotFound();
}
}

Expand All @@ -126,7 +126,7 @@ ResponseEntity<String> getPackageCallgraph(@PathVariable("pkg") String packageNa
return Responses.ok(result);
}
catch (IllegalArgumentException e) {
return Responses.badRequest();
return Responses.packageVersionNotFound();
}
}

Expand Down

0 comments on commit 240a5a3

Please sign in to comment.