1 17 package org.alfresco.error; 18 19 import org.alfresco.i18n.I18NUtil; 20 21 26 public class AlfrescoRuntimeException extends RuntimeException 27 { 28 31 private static final long serialVersionUID = 3834594313622859827L; 32 33 38 public AlfrescoRuntimeException(String msgId) 39 { 40 super(resolveMessage(msgId, null)); 41 } 42 43 49 public AlfrescoRuntimeException(String msgId, Object [] msgParams) 50 { 51 super(resolveMessage(msgId, msgParams)); 52 } 53 54 60 public AlfrescoRuntimeException(String msgId, Throwable cause) 61 { 62 super(resolveMessage(msgId, null), cause); 63 } 64 65 72 public AlfrescoRuntimeException(String msgId, Object [] msgParams, Throwable cause) 73 { 74 super(resolveMessage(msgId, msgParams), cause); 75 } 76 77 87 private static String resolveMessage(String messageId, Object [] params) 88 { 89 String message = I18NUtil.getMessage(messageId, params); 90 if (message == null) 91 { 92 message = messageId; 94 } 95 return message; 96 } 97 } 98 | Popular Tags |