EmbeddedEtcher
error.h File Reference

Error logging functionalities of the operating system. More...

#include "ostypes.h"
#include "ossettings.h"
Include dependency graph for error.h:

Go to the source code of this file.

Macros

#define DEBUG_MSG(MSG, ...)
 
#define THROW_ERROR(ERROR_TYPE)   osPrintError(__FILE__, __LINE__, ERROR_TYPE)
 
#define THROW_WARNING(WARNING_TYPE)   osPrintWarning(__FILE__, __LINE__, WARNING_TYPE)
 

Functions

uint8_t osExplainError (const char *ifile, const uint8_t iline, const osError_t ierror, char *iomessage)
 
uint8_t osPrintError (const char *ifile, const int iline, const osError_t ierror)
 
uint8_t osExplainWarning (const char *ifile, const uint8_t iline, const osWarning_t ierror, char *iomessage)
 
uint8_t osPrintWarning (const char *ifile, const int iline, const osWarning_t ierror)
 

Detailed Description

Error logging functionalities of the operating system.

Author
Maximilian Stiefel
Date
8 Jan 2018

Macro Definition Documentation

◆ DEBUG_MSG

#define DEBUG_MSG (   MSG,
  ... 
)

Create smart debug messages, which are disable if DEBUG is not defined.

◆ THROW_ERROR

#define THROW_ERROR (   ERROR_TYPE)    osPrintError(__FILE__, __LINE__, ERROR_TYPE)

Throws an error given an error type.

◆ THROW_WARNING

#define THROW_WARNING (   WARNING_TYPE)    osPrintWarning(__FILE__, __LINE__, WARNING_TYPE)

Throws a warning given a warning type.

Function Documentation

◆ osExplainError()

uint8_t osExplainError ( const char *  ifile,
const uint8_t  iline,
const osError_t  ierror,
char *  iomessage 
)

Creating a error message string from inter alia an error code.

Parameters
ifileFilename where error occurs.
ilineLine where error occurs.
ierrorError code.
messageMessage related to the error.
Return values
1(SUCCESS) or 0 (FAILURE).

◆ osExplainWarning()

uint8_t osExplainWarning ( const char *  ifile,
const uint8_t  iline,
const osWarning_t  ierror,
char *  iomessage 
)

Creating a warning message string from inter alia a warning code.

Parameters
ifileFilename where warning occurs.
ilineLine where warning occurs.
ierrorWarning code.
messageMessage related to the warning.
Return values
1(SUCCESS) or 0 (FAILURE).

◆ osPrintError()

uint8_t osPrintError ( const char *  ifile,
const int  iline,
const osError_t  ierror 
)

Print error. This is where the error output can be redirected (later).

Parameters
ifileFilename where error occurs.
ilineLine where error occurs.
ierrorError code.
Return values
1(SUCCESS) or 0 (FAILURE).

◆ osPrintWarning()

uint8_t osPrintWarning ( const char *  ifile,
const int  iline,
const osWarning_t  ierror 
)

Print warning. This is where the warning output can be redirected (later).

Parameters
ifileFilename where warning occurs.
ilineLine where warning occurs.
ierrorWarning code.
Return values
1(SUCCESS) or 0 (FAILURE).