MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ErrorReporter.hpp
1 /*
2  Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef ERRORREPORTER_H
19 #define ERRORREPORTER_H
20 
21 #include <ndb_global.h>
22 #include <ndbd_exit_codes.h>
23 
24 #include "../ndbd.hpp"
25 
27 {
28 public:
29  static void handleAssert(const char* message,
30  const char* file,
31  int line, int ec = NDBD_EXIT_PRGERR)
32  ATTRIBUTE_NORETURN;
33 
34  static void handleError(int faultID,
35  const char* problemData,
36  const char* objRef,
37  enum NdbShutdownType = NST_ErrorHandler)
38  ATTRIBUTE_NORETURN;
39 
40  static void formatMessage(int thr_no,
41  Uint32 num_threads, int faultID,
42  const char* problemData,
43  const char* objRef,
44  const char* theNameOfTheTraceFile,
45  char* messptr);
46 
47  static int get_trace_no();
48 
49  static const char* formatTimeStampString();
50 
51 private:
52  static enum NdbShutdownType s_errorHandlerShutdownType;
53 };
54 
55 #endif