Skip to content
Snippets Groups Projects
Commit db307666 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

error message is more appropriate

parent 19d4f8f3
No related branches found
No related tags found
2 merge requests!412changes from 12.1.0~beta.1 into master,!405Resolve "Custom overlays are not sorted in numeric order"
......@@ -241,7 +241,7 @@ public class OverlayRestImpl extends BaseRestImpl {
layoutDao.update(layout);
return getOverlayById(token, layout.getModel().getProject().getProjectId(), overlayId);
} catch (NumberFormatException e) {
throw new ObjectNotFoundException("overlay doesn't exist");
throw new QueryException("invliad overlay id", e);
}
}
......@@ -314,7 +314,8 @@ public class OverlayRestImpl extends BaseRestImpl {
}
public Map<String, Object> addOverlay(String token, String projectId, String name, String description, String content,
String fileId, String filename, String type, String googleLicenseConsent) throws SecurityException, QueryException, IOException {
String fileId, String filename, String type, String googleLicenseConsent)
throws SecurityException, QueryException, IOException {
User user = getUserService().getUserByToken(token);
if (Configuration.ANONYMOUS_LOGIN.equals(user.getLogin())) {
throw new SecurityException("You have no privileges to add overlay");
......@@ -355,9 +356,10 @@ public class OverlayRestImpl extends BaseRestImpl {
}
}
Layout layout = layoutService.createLayout(new CreateLayoutParams().async(false).colorInputStream(stream)
.description(description).layoutFileName(filename).model(model).name(name).user(user)
.colorSchemaType(colorSchemaType).directory(".").googleLicenseConsent(googleLicenseConsent.equalsIgnoreCase("true")));
Layout layout = layoutService
.createLayout(new CreateLayoutParams().async(false).colorInputStream(stream).description(description)
.layoutFileName(filename).model(model).name(name).user(user).colorSchemaType(colorSchemaType)
.directory(".").googleLicenseConsent(googleLicenseConsent.equalsIgnoreCase("true")));
int count = layoutService.getCustomLayouts(model, token, false, user).size();
layout.setOrderIndex(count);
......
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