- 오류가 시스템 레벨에서 발생한다면, 예외(Exception)는 개발자가 구현한 로직에서 발생한다.
- 예외는 발생할 상황을 미리 예측하여 처리할 수 있다.
- 예외는 개발자가 처리할 수 있기 때문에 예외를 구분하고 그에 대한 처리 방법을 명확히 알고 적용하는 것이 중요하다.
Exception
| 종류 | 내용 |
| ClassNotFoundException | 클래스를 찾지 못함 |
| CloneNotSupportedException | 인터페이스를 미구현함 |
| IllegalAccessException | 클래스에 접근 불가함 |
| InstantiationException | 추상 클래스, 인터페이스를 인스턴스화 하고자 함 |
| InterruptedException | Thread가 중단됨 |
| NoSuchFieldException | 지정된 필드가 없음 |
| NoSuchMethodException | 지정된 메소드가 없음 |
IOException
| [IOException] CharConversionException | 문자 변환에서 예외 발생함 |
| [IOException] EOFException | 파일의 끝에 도달함 |
| [IOException] FileNotFoundException | 파일을 찾지 못함 |
| [IOException] InterruptedIOException | 입출력 처리가 중단됨 |
| [IOException][ObjectStreamException] InvalidClassException | 클래스 내의 Serialize 처리에 관한 문제가 있음 |
| [IOException][ObjectStreamException] InvalidObjectException | Serialize 된 Object의 검증이 실패함 |
| [IOException][ObjectStreamException] NotActiveException | Stream 환경이 Active 하지 않을 때 메소드를 호출함 |
| [IOException][ObjectStreamException] NotSerializableException | Object를 Serialize 할 수 없음 |
| [IOException][ObjectStreamException] OptionalDataException | Object를 읽을 때 예상 값과 다른 결과가 나옴 |
| [IOException][ObjectStreamException] StreamCorruptedException | 읽은 Data Stream이 손상됨 |
| [IOException][ObjectStreamException] WriteAbortedException | 값을 쓰던 중 예외가 발생한 Stream을 읽음 |
| [IOException] SyncFailedException | 시스템 버퍼를 동기화시키는 FileDescriptor.sync()의 호출이 실패함 |
| [IOException] UnsupportedEncodingException | 지정된 문자 부호화 형식을 지원하지 않음 |
| [IOException] UTFDataFormatException | 올바르지 못한 UTF-8 방식의 문자열을 만남 |
RuntimeException
| [RuntimeException] ArithmeticException | 산술 예외가 발생함 |
| [RuntimeException] ArrayStoreException | 배열에 올바르지 못한 형식의 Object를 저장함 |
| [RuntimeException] [IllegalArgumentException] IllegalThreadStateException | Thread가 요구한 처리를 하기 적합한 상태가 아님 |
| [RuntimeException] [IllegalArgumentException] NumberFormatException | 올바르지 못한 값을 Number로 변환하고자 함 |
| [RuntimeException] IllegalMonitorStateException | Monitor(멀티스레드가 객체의 인스턴스 변수 혹은 클래스의 클래스 변수에 접근 시 동기화 지원)의 상태가 잘못됨 |
| [RuntimeException] IllegalStateException | 메소드가 요구한 처리를 수행하기 적합한 상태가 아님 |
| [RuntimeException] [IndexOutOfBoundException] ArrayIndexOutOfBoundsException | 배열의 범위 밖 Index를 요청함 |
| [RuntimeException] [IndexOutOfBoundException] StringIndexOutOfBoundsException | 문자열의 범위 밖 Index를 요청함 |
| [RuntimeException] NegativeArraySizeException | 배열의 크기를 음의 크기로 지정함 |
| [RuntimeException] NullPointerException | Null Object에 접근함 |
| [RuntimeException] SecurityException | 보안을 위반함 |
| [RuntimeException] UnsupportedOperationException | 지원하지 않는 연산을 수행함 |
LinkageError
| [LinkageError] ClassCircularityError | 클래스 초기화 중 순환 참조가 검출됨 |
| [LinkageError] [ClassFormatError] UnsupportedClassVersionError | JVM이 지원되지 않는 버전의 클래스 파일을 읽음 |
| [LinkageError] ExceptionInInitializerError | static initializer의 예외가 발생함 |
| [LinkageError] [IncompatibleClassChangeError] AbstracMethodError | 추상 메소드를 호출함 |
| [LinkageError] ClassCircularityError | 클래스 초기화 중 순환 참조가 검출됨 |
| [LinkageError] ClassCircularityError | 클래스 초기화 중 순환 참조가 검출됨 |
Exception
https://shnoble.tistory.com/82
https://medium.com/@yeongpal/android-error-종류-및-내용-4408e790140a
'Android > Debugging' 카테고리의 다른 글
| Android GoogleMap Ensure that the "Google Maps Android API v2" is enabled. 구글맵 키 오류 (1) | 2022.08.01 |
|---|---|
| 무선 Debugging 사용 (1) | 2022.03.22 |
| Result API registerForActivityResult() / startActivityForResult() deprecated (0) | 2022.03.21 |
| Emulator Toast 보이지 않을때 (0) | 2022.03.09 |
| Emulator / System UI isn't responding 해결법 (0) | 2022.01.19 |