acm.util.ErrorException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javakarel Show documentation
Show all versions of javakarel Show documentation
This the original Stanford Karel for Java, packaged for Maven. ACM Library is included. See also https://cs.stanford.edu/people/eroberts/karel-the-robot-learns-java.pdf
The newest version!
/*
* @(#)ErrorException.java 1.99.1 08/12/08
*/
// ************************************************************************
// * Copyright (c) 2008 by the Association for Computing Machinery *
// * *
// * The Java Task Force seeks to impose few restrictions on the use of *
// * these packages so that users have as much freedom as possible to *
// * use this software in constructive ways and can make the benefits of *
// * that work available to others. In view of the legal complexities *
// * of software development, however, it is essential for the ACM to *
// * maintain its copyright to guard against attempts by others to *
// * claim ownership rights. The full text of the JTF Software License *
// * is available at the following URL: *
// * *
// * http://www.acm.org/jtf/jtf-software-license.pdf *
// * *
// ************************************************************************
package acm.util;
/* Class: ErrorException */
/**
* This class allows errors to be reported in a consistent way.
* Clients typically call
*
*
* throw new ErrorException(msg);
*
*
*
Because ErrorException
is a subclass of RuntimeException
,
* this exception need not be declared in throws
clauses.
*/
public class ErrorException extends RuntimeException {
/* Constructor: ErrorException(msg) */
/**
* Creates an ErrorException
with the specified message.
*
* Example: throw new ErrorException(msg);
* @param msg The error message to be reported
*/
public ErrorException(String msg) {
super(msg);
}
/* Constructor: ErrorException(ex) */
/**
* Creates an ErrorException
using an existing exception.
*
* Example: throw new ErrorException(ex);
* @param ex The exception to be reported
*/
public ErrorException(Exception ex) {
super(ex.getClass().getName() + ": " + ex.getMessage());
}
}