Skip to content
Merged
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
16 changes: 11 additions & 5 deletions src/sentry/plugins/providers/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from rest_framework.response import Response

from sentry.api.serializers import serialize
from sentry.exceptions import PluginError
from sentry.models import Repository
from sentry.plugins.config import ConfigValidator

Expand Down Expand Up @@ -46,11 +47,16 @@ def dispatch(self, request, organization, **kwargs):
except Exception as e:
return self.handle_api_error(e)

result = self.create_repository(
organization=organization,
data=config,
actor=request.user,
)
try:
result = self.create_repository(
organization=organization,
data=config,
actor=request.user,
)
except PluginError as e:
return Response({
'errors': {'__all__': e.message},
}, status=400)

repo = Repository.objects.create(
organization_id=organization.id,
Expand Down