1 /*
2  * Copyright 2006-2012 The FLWOR Foundation.
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 
17 #ifndef API_DIAGNOSTIC_HANDLER_H
18 #define API_DIAGNOSTIC_HANDLER_H
19 
20 /**
21  * When registered with an XQuery object, a %DiagnosticHandler handles all
22  * exceptions that otherwise would have been thrown or reported.
23  */
24 class DiagnosticHandler : public zorba::DiagnosticHandler
25 {
26  private:
27   void error (const zorba::ZorbaException &ze);
28   void warning (const zorba::XQueryException &xw);
29  public:
DiagnosticHandler()30   DiagnosticHandler() {};
31   virtual ~DiagnosticHandler();
32 
33   /**
34    * This function is called for all exceptions.
35    *
36    * @param ze The exception.
37    */
38  virtual void error(const ZorbaException &ze);
39   //virtual void warning(const XQueryWarning &xw);
40 }; // class DiagnosticHandler
41 
42 #endif
43