34 const char *json_io_exception::get_main_message()
39 return "fgetc() failed";
41 return "read() failed";
42 case unexpected_result_from_read_e:
43 return "unexpected result from read()";
44 case write_fd_failed_e:
45 return "write() failed";
46 case write_file_failed_e:
47 return "fwrite() failed";
48 case too_many_put_back_e:
49 return "internal error, too many characters put back into a reader";
50 case message_too_long_e:
51 return "maximum configured message length exceeded";
52 case file_open_failed_e:
53 return "file open failed";
61 strncpy(m_message, get_main_message(), max_message_length);
66 char buffer[max_message_length];
68 snprintf(m_message, max_message_length,
"%s : %s", get_main_message(), strerror_r(posix_errno, buffer, max_message_length));
73 snprintf(m_message, max_message_length,
"%s : %ld", get_main_message(), s);
Base class for all exceptions thrown by the library.
#define NAMESPACE
You can change the namespace of the whole library by changing this value.
Common defs needed everywhere and, as far as is possible, platform specific changes.
The json_io_exception class.