Bug 4104: Show users adapted error messages when any operation fails on server

This commit is contained in:
Henri Kohlberg committed 2018-09-17 15:26:55 +02:00
1 parent 8c2f0c15c2
commit 4bf6f65085
4 files changed
+36 -9

No files matched your search

@@ -6478,8 +6478,9 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet
boolean successful = getService().getTaggingService().addTag(leaderboardName, raceColumnName, fleetName, tag,
comment, imageURL, visibleForPublic, raceTimepoint);
if (!successful) {
successInfo = new SuccessInfo(false, getService().getTaggingService().getLastErrorCode().getMessage(), null,
null);
String message = serverStringMessages.get(getClientLocale(),
getService().getTaggingService().getLastErrorCode().getCode());
successInfo = new SuccessInfo(false, message, null, null);
}
return successInfo;
}
@@ -6490,8 +6491,9 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet
boolean successful = getService().getTaggingService().removeTag(leaderboardName, raceColumnName, fleetName,
tag);
if (!successful) {
successInfo = new SuccessInfo(false, getService().getTaggingService().getLastErrorCode().getMessage(), null,
null);
String message = serverStringMessages.get(getClientLocale(),
getService().getTaggingService().getLastErrorCode().getCode());
successInfo = new SuccessInfo(false, message, null, null);
}
return successInfo;
}
@@ -6503,8 +6505,9 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet
boolean successful = getService().getTaggingService().updateTag(leaderboardName, raceColumnName, fleetName,
tagToUpdate, tag, comment, imageURL, visibleForPublic);
if (!successful) {
successInfo = new SuccessInfo(false, getService().getTaggingService().getLastErrorCode().getMessage(), null,
null);
String message = serverStringMessages.get(getClientLocale(),
getService().getTaggingService().getLastErrorCode().getCode());
successInfo = new SuccessInfo(false, message, null, null);
}
return successInfo;
}
@@ -2,4 +2,16 @@ slicingCannotSliceRace=Can not slice race
slicingRaceColumnAlreadyUsedThe=Race column name is already used in the given regatta
slicingTimeRangeOutOfBounds=The TimeRange to slice is not part of the race
slicingCouldNotObtainRace=Could not obtain sliced race
slicingError=Error slicing race
slicingError=Error slicing race
unknownError=Unknown error
notLoggedIn=You are not logged in
missingPermissions=Missing permissions
securityServiceNotFound=Security service not found
racelogNotFound=Racelog not found
tagNotRevokable=This tag cannot be revoked
tagAlreadyExists=Tag does already exist, duplicated tags are not allowed
tagAlreadyRemoved=Tag cannot be removed twice!
tagNotEmpty=Tag may not be empty
timepointNotEmpty=Timepoint may not be empty
tagTooLong=Tag is too long
commentToLong=Comment is too long
@@ -2,4 +2,16 @@ slicingCannotSliceRace=Rennen kann nicht geschnitten werden
slicingRaceColumnAlreadyUsedThe=Der Rennspaltenname ist in der Regatta bereits verwendet
slicingTimeRangeOutOfBounds=Die angegebene Zeitspanne ist ausserhalb des Rennens
slicingCouldNotObtainRace=Das geschnittene Rennen konnte nicht gefunden werden
slicingError=Fehler beim Schneiden des Rennens
slicingError=Fehler beim Schneiden des Rennens
unknownError=Unbekannter Fehler
notLoggedIn=Du bist nicht eingeloggt
missingPermissions=Fehlende Berechtigung
securityServiceNotFound=Sicherheits-Service konnte nicht gefunden werden
racelogNotFound=Racelog konnte nicht gefunden werden
tagNotRevokable=Dieser Tag ist nicht umkehrbar
tagAlreadyExists=Dieser Tag existiert bereits
tagAlreadyRemoved=Dieser Tag wurde bereits geloescht
tagNotEmpty=Der Tag darf nicht leer sein
timepointNotEmpty=Der Zeitpunkt darf nicht leer sein
tagTooLong=Der Tag ist zu lang
commentToLong=Der Kommentar ist zu lang
@@ -14,7 +14,7 @@ public interface TaggingService {
*/
public enum ErrorCode {
UNKNOWN_ERROR("unknownError", "Unknown error"),
NOT_LOGGED_IN("notLoggedin", "You are not logged in"),
NOT_LOGGED_IN("notLoggedIn", "You are not logged in"),
MISSING_PERMISSIONS("missingPermissions", "Missing permissions"),
SECURITY_SERIVCE_NOT_FOUND("securityServiceNotFound", "Security service not found"),
RACELOG_NOT_FOUND("racelogNotFound", "Racelog not found"),