mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-07 03:37:20 +02:00
improve error handling on repository import if the credentials were wrong or missing
This commit is contained in:
@@ -46,6 +46,7 @@ import sonia.scm.repository.RepositoryManager;
|
||||
import sonia.scm.repository.RepositoryPermissions;
|
||||
import sonia.scm.repository.RepositoryType;
|
||||
import sonia.scm.repository.api.Command;
|
||||
import sonia.scm.repository.api.ImportFailedException;
|
||||
import sonia.scm.repository.api.PullCommandBuilder;
|
||||
import sonia.scm.repository.api.RepositoryService;
|
||||
import sonia.scm.repository.api.RepositoryServiceFactory;
|
||||
@@ -216,9 +217,12 @@ public class RepositoryImportResource {
|
||||
}
|
||||
|
||||
pullCommand.pull(request.getUrl());
|
||||
} catch (ImportFailedException ex) {
|
||||
handleImportFailure(ex, repository);
|
||||
throw ex;
|
||||
} catch (Exception ex) {
|
||||
handleImportFailure(ex, repository);
|
||||
throw new InternalRepositoryException(repository, "Import failed. Most likely the credentials are wrong or missing.", ex);
|
||||
throw new InternalRepositoryException(repository, "Repository Import failed.", ex);
|
||||
}
|
||||
|
||||
return Response.created(URI.create(resourceLinks.repository().self(repository.getNamespace(), repository.getName()))).build();
|
||||
|
||||
@@ -286,12 +286,16 @@
|
||||
"FVS9JY1T21": {
|
||||
"displayName": "Fehler bei der Anfrage",
|
||||
"description": "Bei der Anfrage trat ein Fehler auf. Prüfen Sie bitte den Status der HTTP Antwort und die konkrete Meldung."
|
||||
},
|
||||
"D6SHRfqQw1": {
|
||||
"displayName": "Repository Import fehlgeschlagen",
|
||||
"description": "Das Repository konnte nicht importiert werden. Entweder wurden die Zugangsdaten (Benutzername/Passwort) nicht gesetzt oder sind fehlerhaft. Bitte prüfen Sie Ihre Eingaben."
|
||||
}
|
||||
},
|
||||
"namespaceStrategies": {
|
||||
"UsernameNamespaceStrategy": "Benutzername",
|
||||
"CustomNamespaceStrategy": "Benutzerdefiniert",
|
||||
"CurrentYearNamespaceStrategy": "Aktuelles Jahr",
|
||||
"UsernameNamespaceStrategy": "Benutzername",
|
||||
"CustomNamespaceStrategy": "Benutzerdefiniert",
|
||||
"CurrentYearNamespaceStrategy": "Aktuelles Jahr",
|
||||
"RepositoryTypeNamespaceStrategy": "Repository Typ"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,6 +286,10 @@
|
||||
"FVS9JY1T21": {
|
||||
"displayName": "Error in the request",
|
||||
"description": "While processing the request there was an error. Please check the http return status and the concrete error message."
|
||||
},
|
||||
"D6SHRfqQw1": {
|
||||
"displayName": "Repository import failed",
|
||||
"description": "The repository could not be imported. Either the credentials (username/password) are wrong or missing. Please check your inputs."
|
||||
}
|
||||
},
|
||||
"namespaceStrategies": {
|
||||
|
||||
Reference in New Issue
Block a user