Changeset 208


Ignore:
Timestamp:
03/03/10 13:19:15 (14 years ago)
Author:
patdui
Message:
  • some better error handling
Location:
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/ComponentRegistryImpl.java

    r207 r208  
    330330    private void checkAuthorisation(AbstractDescription desc, Principal principal) throws UserUnauthorizedException {
    331331        if (!principal.getName().equals(desc.getCreatorName())) {
    332             throw new UserUnauthorizedException("Unauthorized operation user: " + principal.getName()
    333                     + " was not the creator of profile/component (description=" + desc + ").");
     332            throw new UserUnauthorizedException("Unauthorized operation user '" + principal.getName()
     333                    + "' was not the creator of profile/component (description=" + desc + ").");
    334334        }
    335335    }
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/ComponentRegistryRestService.java

    r207 r208  
    9999            return Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build();
    100100        } catch (UserUnauthorizedException e) {
    101             LOG.info("Component with id: " + componentId + " deletion failed.", e);
     101            LOG.info("Component with id: " + componentId + " deletion failed: "+e.getMessage());
    102102            return Response.serverError().status(Status.UNAUTHORIZED).build();
    103103        }
     
    145145            return Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build();
    146146        } catch (UserUnauthorizedException e) {
    147             LOG.info("Profile with id: " + profileId + " deletion failed.", e);
     147            LOG.info("Profile with id: " + profileId + " deletion failed: "+e.getMessage());
    148148            return Response.serverError().status(Status.UNAUTHORIZED).build();
    149149        }
Note: See TracChangeset for help on using the changeset viewer.