From 6466157c906f132ab6440aa0682933bb59397745 Mon Sep 17 00:00:00 2001 From: Martin Voigt Date: Mon, 20 Feb 2017 13:21:57 +0100 Subject: [PATCH] [minor] use execpetion message instead of empty text, if no restrictable is given for unauthorized access (#2) --- .../java/li/strolch/rest/StrolchRestfulExceptionMapper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/StrolchRestfulExceptionMapper.java b/li.strolch.rest/src/main/java/li/strolch/rest/StrolchRestfulExceptionMapper.java index 5a3ef6c77..4307389de 100644 --- a/li.strolch.rest/src/main/java/li/strolch/rest/StrolchRestfulExceptionMapper.java +++ b/li.strolch.rest/src/main/java/li/strolch/rest/StrolchRestfulExceptionMapper.java @@ -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 { @@ -53,7 +52,9 @@ public class StrolchRestfulExceptionMapper implements ExceptionMapper 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(" - ");