Skip to content
Snippets Groups Projects
Verified Commit db206c15 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

fix: return the exception's string representation

parent fc9d9c1c
No related branches found
No related tags found
No related merge requests found
Pipeline #7058 passed
......@@ -614,11 +614,8 @@ class APIScheduleViewSet(
resolution = resolve_conflicts(request.data, pk, show_pk)
# FIXME: Find a better way to do this.
# The exception is thrown by the instantiate_upcoming_schedule function.
except RRule.DoesNotExist:
return JsonResponse(
{"rruleId": ["Ungültige rrule - Object existiert nicht."]},
status=status.HTTP_400_BAD_REQUEST,
)
except RRule.DoesNotExist as exc:
return JsonResponse({"rruleId": str(exc)}, status=status.HTTP_400_BAD_REQUEST)
except ScheduleConflictError as exc:
return Response(exc.conflicts, status.HTTP_409_CONFLICT)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment