Skip to content

Commit

Permalink
fix: Throw conflict error in campaing creation
Browse files Browse the repository at this point in the history
  • Loading branch information
ntatoud committed May 17, 2024
1 parent c4e1f68 commit 57d8cad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/server/esp/dsc/dscProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ class DscProvider {
throw new BadRequest(message);
}

if (status === 409) {
throw new Conflict(message);
}

// Log the error and throw a generic error if it doesn't match specific cases
logger.error('Error in API call:', error);
throw new Error('An error occurred while communicating with the API.');
Expand Down

0 comments on commit 57d8cad

Please sign in to comment.