try {
newLabelId = labelDAO.add(mailbox, label);
} catch (IllegalLabelException ile) {
throw new BadRequestException(ile.getMessage());
} catch (ExistingLabelException ele) {
throw new RESTApplicationException(Status.CONFLICT, ele.getMessage());
} catch (Exception e) {
logger.error("Adding label failed", e);
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
}