001 package org.nakedobjects.applib;
002
003 /**
004 * Indicates that the persistence of an object failed.
005 */
006 public class PersistFailedException extends RuntimeException {
007 private static final long serialVersionUID = 1L;
008 private Throwable cause;
009
010 public PersistFailedException() {
011 super();
012 }
013
014 public PersistFailedException(final String msg) {
015 super(msg);
016 }
017
018 public PersistFailedException(final Throwable cause) {
019 this(cause.getMessage());
020 this.cause = cause;
021 }
022
023 public PersistFailedException(final String msg, final Throwable cause) {
024 this(msg);
025 this.cause = cause;
026 }
027
028 @Override
029 public Throwable getCause() {
030 return cause;
031 }
032 }
033 // Copyright (c) Naked Objects Group Ltd.