21 #ifndef UTILITIESEXCEPTIONS_H
22 #define UTILITIESEXCEPTIONS_H
27 #include "baseexception.h"
34 #pragma warning(disable:4996)
65 strncpy(m_reason, reason, 256);
67 sprintf(m_errorMessage,
"Generic runtime exception, reason: %s", m_reason);
68 m_errorMessage[511] =
'\0';
79 strncpy(m_reason, other.m_reason, 256);
81 strncpy(m_errorMessage, other.m_errorMessage, 512);
82 m_errorMessage[511] =
'\0';
96 BaseException::operator=(other);
97 strncpy(m_reason, other.m_reason, 256);
99 strncpy(m_errorMessage, other.m_errorMessage, 512);
100 m_errorMessage[511] =
'\0';
117 virtual const char *what()
const throw()
119 return m_errorMessage;
127 const char *reason()
const throw()
147 char m_errorMessage[512];
183 strncpy(m_reason, origException.what(), 256);
184 m_reason[255] =
'\0';
185 sprintf(m_errorMessage,
"Standard library exception thrown, what(): %s", m_reason);
186 m_errorMessage[511] =
'\0';
197 strncpy(m_reason, other.m_reason, 256);
198 m_reason[255] =
'\0';
199 strncpy(m_errorMessage, other.m_errorMessage, 512);
200 m_errorMessage[511] =
'\0';
210 if (&other ==
this) {
214 BaseException::operator=(other);
215 strncpy(m_reason, other.m_reason, 256);
216 m_reason[255] =
'\0';
217 strncpy(m_errorMessage, other.m_errorMessage, 512);
218 m_errorMessage[511] =
'\0';
235 virtual const char *what()
const throw()
237 return m_errorMessage;
245 const char *reason()
const throw()
265 char m_errorMessage[512];
279 DownloaderAlreadyAssociated,
282 UploaderAlreadyAssociated
295 m_errorType(errorType)
297 switch (m_errorType) {
298 case DownloaderAlreadyAssociated:
299 sprintf(m_errorMessage,
"The downloader is already associated with another uploader");
301 case UploaderAlreadyAssociated:
302 sprintf(m_errorMessage,
"The uploader is already associated with another downloader");
305 m_errorMessage[255] =
'\0';
314 BaseException(other),
315 m_errorType(other.m_errorType)
317 strncpy(m_errorMessage, other.m_errorMessage, 256);
318 m_errorMessage[255] =
'\0';
328 if (&other ==
this) {
332 BaseException::operator=(other);
333 m_errorType = other.m_errorType;
334 strncpy(m_errorMessage, other.m_errorMessage, 256);
335 m_errorMessage[255] =
'\0';
352 virtual const char *what()
const throw()
354 return m_errorMessage;
377 ErrorType m_errorType;
382 char m_errorMessage[256];
396 DownloaderNotPresent,
414 m_errorType(errorType)
416 switch (m_errorType) {
417 case DownloaderNotPresent:
418 sprintf(m_errorMessage,
"The uploader is not associated with a downloader and cannot work correctly in this situation");
420 case UploaderNotPresent:
421 sprintf(m_errorMessage,
"The downloader is not associated with an uploader and cannot work correctly in this situation");
424 m_errorMessage[255] =
'\0';
433 BaseException(other),
434 m_errorType(other.m_errorType)
436 strncpy(m_errorMessage, other.m_errorMessage, 256);
437 m_errorMessage[255] =
'\0';
447 if (&other ==
this) {
451 BaseException::operator=(other);
452 m_errorType = other.m_errorType;
453 strncpy(m_errorMessage, other.m_errorMessage, 256);
454 m_errorMessage[255] =
'\0';
471 virtual const char *what()
const throw()
473 return m_errorMessage;
496 ErrorType m_errorType;
501 char m_errorMessage[256];
521 strncpy(m_description, description, 256);
522 m_description[255] =
'\0';
523 sprintf(m_errorMessage,
"Invalid combination of NewDatumAvailableBehavior and objects for notification: %s", m_description);
524 m_errorMessage[511] =
'\0';
535 strncpy(m_description, other.m_description, 256);
536 m_description[255] =
'\0';
537 strncpy(m_errorMessage, other.m_errorMessage, 512);
538 m_errorMessage[511] =
'\0';
548 if (&other ==
this) {
552 BaseException::operator=(other);
553 strncpy(m_description, other.m_description, 256);
554 m_description[255] =
'\0';
555 strncpy(m_errorMessage, other.m_errorMessage, 512);
556 m_errorMessage[511] =
'\0';
573 virtual const char *what()
const throw()
575 return m_errorMessage;
583 const char *description()
const throw()
585 return m_description;
598 char m_description[256];
603 char m_errorMessage[512];
618 sprintf(m_errorMessage,
"Circular dependency found");
619 m_errorMessage[255] =
'\0';
630 strncpy(m_errorMessage, other.m_errorMessage, 256);
631 m_errorMessage[255] =
'\0';
641 if (&other ==
this) {
645 BaseException::operator=(other);
646 strncpy(m_errorMessage, other.m_errorMessage, 256);
647 m_errorMessage[255] =
'\0';
664 virtual const char *what()
const throw()
666 return m_errorMessage;
679 char m_errorMessage[256];
685 #if defined(_MSC_VER)