• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.hoststubgen
17 
18 /**
19  * We will not print the stack trace for exceptions implementing it.
20  */
21 interface UserErrorException
22 
23 /**
24  * Exceptions about parsing class files.
25  */
26 class ClassParseException(message: String) : Exception(message)
27 
28 /**
29  * Use it for internal exception that really shouldn't happen.
30  */
31 class HostStubGenInternalException(message: String) : Exception(message)
32 
33 /**
34  * Exceptions about the content in a jar file.
35  */
36 class InvalidJarFileException(message: String) : Exception(message), UserErrorException
37 
38 /**
39  * Exceptions missing classes, fields, methods, etc.
40  */
41 class UnknownApiException(message: String) : Exception(message), UserErrorException
42 
43 /**
44  * Exceptions related to invalid annotations -- e.g. more than one visibility annotation
45  * on a single API.
46  */
47 class InvalidAnnotationException(message: String) : Exception(message), UserErrorException
48 
49 /**
50  * We use this for general "user" errors.
51  */
52 class HostStubGenUserErrorException(message: String) : Exception(message), UserErrorException
53