1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package java.lang; 19 20 21 /** 22 * {@code Error} is the superclass of all classes that represent unrecoverable 23 * errors. When errors are thrown, they should not be caught by application 24 * code. 25 * 26 * @see Throwable 27 * @see Exception 28 * @see RuntimeException 29 * @since Android 1.0 30 */ 31 public class Error extends Throwable { 32 33 private static final long serialVersionUID = 4980196508277280342L; 34 35 /** 36 * Constructs a new {@code Error} that includes the current stack trace. 37 * 38 * @since Android 1.0 39 */ Error()40 public Error() { 41 super(); 42 } 43 44 /** 45 * Constructs a new {@code Error} with the current stack trace and the 46 * specified detail message. 47 * 48 * @param detailMessage 49 * the detail message for this error. 50 * @since Android 1.0 51 */ Error(String detailMessage)52 public Error(String detailMessage) { 53 super(detailMessage); 54 } 55 56 /** 57 * Constructs a new {@code Error} with the current stack trace, the 58 * specified detail message and the specified cause. 59 * 60 * @param detailMessage 61 * the detail message for this error. 62 * @param throwable 63 * the cause of this error. 64 * @since Android 1.0 65 */ Error(String detailMessage, Throwable throwable)66 public Error(String detailMessage, Throwable throwable) { 67 super(detailMessage, throwable); 68 } 69 70 /** 71 * Constructs a new {@code Error} with the current stack trace and the 72 * specified cause. 73 * 74 * @param throwable 75 * the cause of this error. 76 * @since Android 1.0 77 */ Error(Throwable throwable)78 public Error(Throwable throwable) { 79 super(throwable); 80 } 81 } 82