Skip to content

Commit

Permalink
fix: Adds handling for 'SubscriptionNotFound' error in generateReferr…
Browse files Browse the repository at this point in the history
…alRoute
  • Loading branch information
lui7henrique committed Oct 16, 2024
1 parent a131917 commit c1f1b6b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/http/routes/generate-referral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export async function generateReferralRoute(app: FastifyInstance) {
case 'ReferralLinkAlreadyExists':
return reply.status(409).send({ message: error.message })

case 'SubscriptionNotFound':
return reply.status(404).send({ message: error.message })

default:
return reply.status(400).send({ message: 'An error occurred' })
}
Expand Down

0 comments on commit c1f1b6b

Please sign in to comment.