AVPKit
Error.h
1 /*******************************************************************************
2  * Copyright (c) 2024, 2026, Olivier Ayache. All rights reserved.
3  *
4  * This file is part of AVPKit.
5  *
6  * AVPKit is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * AVPKit is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with AVPKit. If not, see <http://www.gnu.org/licenses/>.
18  *******************************************************************************/
19 
20 /*
21  * Error.h
22  *
23  * Created on: Mar 20, 2009
24  * Author: aclarke
25  */
26 
27 #ifndef ERROR_H_
28 #define ERROR_H_
29 
30 #include <com/avpkit/core/IError.h>
31 
32 namespace com { namespace avpkit { namespace core
33 {
34 
35 class Error : public IError
36 {
37  VS_JNIUTILS_REFCOUNTED_OBJECT_PRIVATE_MAKE(Error);
38 public:
39  virtual const char* getDescription();
40  virtual int32_t getErrorNumber();
41  virtual Type getType();
42 
43  static Error* make(int32_t errNo);
44  static Error* make(Type type);
45  static Type errorNumberToType(int32_t errorNo);
46  static int32_t typeToErrorNumber(Type type);
47 protected:
48  Error();
49  virtual ~Error();
50 
51 private:
52  static Error* make(int32_t errNo, Type type);
53 
54  Type mType;
55  int32_t mErrorNo;
56  char mErrorStr[256];
57 
58 };
59 
60 }}}
61 
62 #endif /* ERROR_H_ */
virtual int32_t getErrorNumber()
Return the raw integer value that AVPKit returned and was used to create this IError.
Definition: Error.cpp:102
virtual Type getType()
Get the OS-independent AVPKit type for this error.
Definition: Error.cpp:107
virtual const char * getDescription()
Get a text description for this error.
Definition: Error.cpp:80
Maps from int return codes to defined Error values.
Definition: IError.h:60
Type
A set of errors that AVPKit knows about.
Definition: IError.h:65
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...