SaxonC 13.0.0
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
SaxonApiException.h
1#ifndef SAXON_API_EXCEPTION_H
2#define SAXON_API_EXCEPTION_H
3
5// Copyright (c) 2022 - 2023 Saxonica Limited.
6// This Source Code Form is subject to the terms of the Mozilla Public License,
7// v. 2.0. If a copy of the MPL was not distributed with this file, You can
8// obtain one at http://mozilla.org/MPL/2.0/. This Source Code Form is
9// "Incompatible With Secondary Licenses", as defined by the Mozilla Public
10// License, v. 2.0.
12
13#include "saxonc_export.h"
14#include "saxon_error.h"
15#include "saxonc/SaxonProcessor.h"
16#include <exception>
17#include <iostream>
18
19class SaxonProcessor;
20
25class SAXONC_EXPORT SaxonApiException : public std::exception {
26
27public:
31 SaxonApiException(bool staticError = false);
32
37 SaxonApiException(const char *err);
38
44
50#ifdef _LIBCPP___EXCEPTION_EXCEPTION_H
51 virtual char const* what() const _NOEXCEPT;
52#else
53 virtual const char *what();
54#endif
55
56
57
68 SaxonApiException(const char *message, const char *errorCode,
69 const char *systemId, int linenumber);
70
84 SaxonApiException(saxon_status_t status, const char *message, const char *errorCode,
85 const char *systemId, int linenumber, int numOfErrors);
86
87
92
93 SaxonApiException(saxon_error_t error);
94
98 virtual ~SaxonApiException() throw();
99
106 const char *getErrorCode();
107
114 int getLineNumber();
115
122 const char *getMessage();
123
131 const char *getMessageWithErrorCode();
132
133
137 int staticErrorCount();
138
142 const char *getSystemId();
143
144private:
145 bool isStaticError;
146 saxon_status_t exception_status;
147 std::string message;
148 std::string s_message;
149 std::string ec_message;
150 int lineNumber, numOfErrors;
151 std::string errorCode;
152 std::string systemId;
153};
154
155#endif /* SAXON_API_EXCEPTION_H */
const char * getMessage()
Returns the detail message string as a char array of the throwable, if there is one.
Definition SaxonApiException.cpp:126
const char * getSystemId()
Get the URI of the module associated with the exception, if known.
Definition SaxonApiException.cpp:122
const char * getErrorCode()
Get the error code associated with the current exception, if it exists.
Definition SaxonApiException.cpp:114
int getLineNumber()
Get the line number associated with the exception, if known.
Definition SaxonApiException.cpp:118
const char * getMessageWithErrorCode()
Returns the detail message string as a char array of the throwable, if there is one.
Definition SaxonApiException.cpp:130
SaxonApiException(bool staticError=false)
Default constructor.
Definition SaxonApiException.cpp:26
virtual const char * what()
Returns a pointer to the (constant) error description.
Definition SaxonApiException.cpp:20
int staticErrorCount()
Returns the number of static errors encountered.
Definition SaxonApiException.cpp:134
The SaxonProcessor class acts as a factory for generating XQuery, XPath, Schema and XSLT compilers.
Definition SaxonProcessor.h:137