Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions contentcuration/contentcuration/views/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ def post(self, request):

return Response({"checkout_url": session.url})

except stripe.error.StripeError as e:
logger.error(f"Stripe error creating checkout session: {e}")
return Response({"error": str(e)}, status=400)
except stripe.error.StripeError:
logger.exception("Stripe error creating checkout session")
return Response({"error": "Unable to create checkout session"}, status=400)


class CreatePortalSessionView(APIView):
Expand All @@ -105,9 +105,9 @@ def post(self, request):
)
return Response({"portal_url": session.url})

except stripe.error.StripeError as e:
logger.error(f"Stripe error creating portal session: {e}")
return Response({"error": str(e)}, status=400)
except stripe.error.StripeError:
logger.exception("Stripe error creating portal session")
return Response({"error": "Unable to create portal session"}, status=400)


class SubscriptionStatusView(APIView):
Expand Down
5 changes: 3 additions & 2 deletions contentcuration/contentcuration/viewsets/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,9 @@ def create(self, request, *args, **kwargs):
try:
self.perform_create(serializer)

except IntegrityError as e:
return Response({"error": str(e)}, status=409)
except IntegrityError:
logging.exception("Integrity error creating channel")
return Response({"error": "Channel could not be created"}, status=409)
instance = serializer.instance
Change.create_change(
generate_create_event(
Expand Down
Loading