java.lang

Class Exception

Implemented Interfaces:
Serializable
Known Direct Subclasses:
AclNotFoundException, ActivationException, AlreadyBoundException, AttributeNotSupportedException, AWTException, BackingStoreException, BadAttributeValueExpException, BadBinaryOpValueExpException, BadLocationException, BadStringOperationException, Base64FormatException, BeanNotFoundException, BerException, BindException, BrokenBarrierException, CacheException, ChainedException, ClassNotFoundException, ClientExecuteException, CloneNotSupportedException, ConfigurationException, ConfigurationException, CreateException, DataFormatException, DatatypeConfigurationException, DatatypeException, DateParseException, DConfigBeanVersionUnsupportedException, DDBeanCreateException, DecoderException, DeploymentManagerCreationException, DestroyFailedException, DigesterLoadingException, DocumentException, DocumentHandlerException, ELException, EmailException, EncoderException, ExecutionException, ExpandVetoException, FeedException, FileUploadException, FinderException, FontFormatException, GeneralSecurityException, GSSException, HeuristicCommitException, HeuristicMixedException, HeuristicRollbackException, HPSFException, HSSFUserException, HyphenationException, IllegalAccessException, IllegalClassFormatException, IllegalUserActionException, InitializationError, InstantiationException, internal_error, InterruptedException, IntrospectionException, InvalidApplicationException, InvalidMidiDataException, InvalidModuleException, InvalidPreferencesFormatException, InvalidTargetObjectTypeException, InvalidTelnetOptionException, InvalidVariableException, InvocationTargetException, InvokerException, IOException, JAXBException, JDOMException, JellyException, JMeterEngineException, JMException, JMSException, JRException, JspException, JXLException, LastOwnerException, LineUnavailableException, MalformedPatternException, MathException, MethodMap.AmbiguousException, MidiUnavailableException, MimeTypeParseException, ModelException, NamingException, NestableException, NestableException, NestedCheckedException, NextIsNullException, NoMoreDataException, NoninvertibleTransformException, NoSuchFieldException, NoSuchMethodException, NoSuchObjectException, NotBoundException, NoTestsRemainException, NotOutlierException, NotOwnerException, NotSupportedException, NumFormatRecordsException, OperationUnsupportedException, ParseException, ParseException, ParseException, ParseException, ParseException, ParseException, ParseException, ParseException, ParseException, ParserConfigurationException, ParserException, PluginException, PortletException, PotentialParameterValue.CouldNotGenerateValueException, PrinterException, PrintException, PrivilegedActionException, PropertySetterException, PropertyVetoException, RefreshFailedException, RemoveException, RepositoryException, ResourceException, ResourceManagerException, RollbackException, RuntimeException, SAXException, ScheduleFormatException, ScriptException, SCXMLExpressionException, ServerNotActiveException, ServiceException, ServletException, SnmpBadSecurityLevelException, SnmpSecurityException, SnmpStatusException, SnmpTooBigException, SnmpUnknownModelException, SnmpUnknownModelLcdException, SnmpUnknownSubSystemException, SOAPException, SQLException, StorageException, SystemException, TargetException, TargetLostException, TestServerSideExceptions.NotSerializableException, TestServerSideExceptions.SerializableException, TFTPPacketException, TimeoutController.TimeoutException, TimeoutException, TooManyListenersException, TransformerException, UnmodifiableClassException, UnsupportedAudioFileException, UnsupportedCallbackException, UnsupportedFlavorException, UnsupportedLookAndFeelException, URISyntaxException, ValidationException, XAException, XMLParseException, XMLSchemaException, XMLStreamException, XPathException, XPathException

public class Exception
extends Throwable

The class Exception and its subclasses are a form of Throwable that indicates conditions that a reasonable application might want to catch.
Since:
JDK1.0
See Also:
Error, Serialized Form

Constructor Summary

Exception()
Constructs a new exception with null as its detail message.
Exception(String message)
Constructs a new exception with the specified detail message.
Exception(String message, Throwable cause)
Constructs a new exception with the specified detail message and cause.
Exception(Throwable cause)
Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

Method Summary

Methods inherited from class java.lang.Throwable

fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

Exception

public Exception()
Constructs a new exception with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Exception.
Usages and Demos :

View More Examples of Exception()
   1:                 if (hasBeenCalled.get()) {
   2:                     (new Exception()).printStackTrace();
   3:                     throw new AssertionFailedError(
   4:                             "createQueueOfferableOnce called twice");
   5:                 }

View Full Code Here
   1:         assertTrue("Invalid exception conversion", XStreamUtils.convertXStreamException(
   2:                 new StreamException(new Exception()), true) instanceof XStreamMarshallingFailureException);
   3:         assertTrue("Invalid exception conversion", XStreamUtils.convertXStreamException(
   4:         ...
   5:                 new StreamException(new Exception()), false) instanceof XStreamUnmarshallingFailureException);
   6:     }
   7: 
   8:     public void testConvertCannotResolveClassException() {

View Full Code Here
   1:     System.out.println(method(new GenericWrapper<String>("abc")));
   2:     System.out.println(method(new GenericWrapper<Exception>(new Exception())));
   3:     }
   4: }

View Full Code Here
   1:     
   2:     public Exception()
   3:     {
   4:       super();
   5:     }

View Full Code Here

Exception

public Exception(String message)
Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Exception.
Parameters:
message - the detail message. The detail message is saved for later retrieval by the getMessage() method.
Usages and Demos :

View More Examples of Exception(String message)
   1:         {
   2:             throw new Exception("");
   3:         }
   4:         catch (Exception ex)
   5:         {

View Full Code Here
   1:         {
   2:             throw new Exception("");
   3:         }
   4:         catch (Exception ex)
   5:         {

View Full Code Here
   1:         {
   2:             throw new Exception("");
   3:         }
   4:         catch (Exception ex)
   5:         {

View Full Code Here
   1:         assertTrue("Invalid exception conversion",
   2:                 XmlBeansUtils.convertXmlBeansException(new Exception(""), false) instanceof XmlBeansSystemException);
   3: 
   4:     }

View Full Code Here
   1:         if (panel == null) {
   2:             ExceptionDisplay.display(new Exception(""), "You need to call FileSelectionOption.configureOptions() proir to returning it in YourEditor.getEditorOptions()", true, true);
   3:         }
   4:         
   5:         return panel;

View Full Code Here

Exception

public Exception(String message,
                 Throwable cause)
Constructs a new exception with the specified detail message and cause.

Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.

Parameters:
message - the detail message (which is saved for later retrieval by the getMessage() method).
cause - the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Since:
1.4
Usages and Demos :

View More Examples of Exception(String message,Throwable cause)
   1:     if (c1 != c2) {
   2:         throw new Exception("mismatch: " + c1 + ", " + c2);
   3:     }
   4:     }
   5:     public static void main(String[] args) throws Exception {

View Full Code Here
   1: 
   2:         e = new Exception("b", null);
   3:         mbe = toMBeanException(e, "a");
   4:         Assert.assertEquals("a(b)", mbe.getMessage());

View Full Code Here
   1:     if(!(",".equals(s)||")".equals(s)))
   2:       throw new Exception("missing , or )");
   3: 
   4:     roles.put(nr,nc);
   5:       }

View Full Code Here
   1:       {
   2:          throw new Exception("Error::",e);
   3:       }
   4:    }

View Full Code Here
   1:          
   2:          final Exception e   = new Exception( "hello", cause);
   3:          assert( e == ThrowableMapper.map(e) );
   4:          items.add( e );
   5:          

View Full Code Here

Exception

public Exception(Throwable cause)
Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for exceptions that are little more than wrappers for other throwables (for example, PrivilegedActionException).
Parameters:
cause - the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Since:
1.4
Usages and Demos :

View More Examples of Exception(Throwable cause)
   1:         {
   2:             throw new Exception("");
   3:         }
   4:         catch (Exception ex)
   5:         {

View Full Code Here
   1:         {
   2:             throw new Exception("");
   3:         }
   4:         catch (Exception ex)
   5:         {

View Full Code Here
   1:         {
   2:             throw new Exception("");
   3:         }
   4:         catch (Exception ex)
   5:         {

View Full Code Here
   1:         assertTrue("Invalid exception conversion",
   2:                 XmlBeansUtils.convertXmlBeansException(new Exception(""), false) instanceof XmlBeansSystemException);
   3: 
   4:     }

View Full Code Here
   1:         if (panel == null) {
   2:             ExceptionDisplay.display(new Exception(""), "You need to call FileSelectionOption.configureOptions() proir to returning it in YourEditor.getEditorOptions()", true, true);
   3:         }
   4:         
   5:         return panel;

View Full Code Here