Skip to content

Commit

Permalink
Set status code to 409 for saved object conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kpollich committed Jan 10, 2024
1 parent 4b9fc0e commit 6464206
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x-pack/plugins/fleet/server/errors/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
AgentRequestInvalidError,
PackagePolicyRequestError,
FleetNotFoundError,
PackageSavedObjectConflictError,
} from '.';

type IngestErrorHandler = (
Expand Down Expand Up @@ -100,6 +101,9 @@ const getHTTPResponseCode = (error: FleetError): number => {
if (error instanceof ConcurrentInstallOperationError) {
return 409;
}
if (error instanceof PackageSavedObjectConflictError) {
return 409;
}
if (error instanceof PackagePolicyNameExistsError) {
return 409;
}
Expand Down

0 comments on commit 6464206

Please sign in to comment.