[minor] use execpetion message instead of empty text, if no restrictable is given for unauthorized access (#2)

This commit is contained in:
Martin Voigt 2017-02-20 13:21:57 +01:00 committed by Robert von Burg
parent 0852557aaa
commit 6466157c90
1 changed files with 3 additions and 2 deletions

View File

@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory;
import li.strolch.exception.StrolchAccessDeniedException;
import li.strolch.privilege.model.Restrictable;
import li.strolch.rest.model.Result;
import li.strolch.utils.helper.StringHelper;
@Provider
public class StrolchRestfulExceptionMapper implements ExceptionMapper<Exception> {
@ -53,7 +52,9 @@ public class StrolchRestfulExceptionMapper implements ExceptionMapper<Exception>
sb.append(" does not have access to ");
Restrictable restrictable = e.getRestrictable();
if (restrictable == null) {
sb.append(StringHelper.NULL);
// sb.append(StringHelper.NULL);
// use the message
sb.append(e.getMessage());
} else {
sb.append(restrictable.getPrivilegeName());
sb.append(" - ");