Skip to content

Commit 17d591c

Browse files
author
Matthew Fisher
committed
ref(controller): capture all cases in one try/catch block
1 parent da5f383 commit 17d591c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

controller/api/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def scale(self, request, **kwargs):
141141
except (TypeError, ValueError):
142142
return Response({'detail': 'Invalid scaling format'},
143143
status=status.HTTP_400_BAD_REQUEST)
144-
except (ValidationError, EnvironmentError) as e:
144+
except (EnvironmentError, ValidationError) as e:
145145
return Response({'detail': str(e)}, status=status.HTTP_400_BAD_REQUEST)
146146
except RuntimeError as e:
147147
return Response({'detail': str(e)}, status=status.HTTP_503_SERVICE_UNAVAILABLE)

0 commit comments

Comments
 (0)