# Obtaining error values and descriptions.

## Functions

int | irc_errno (irc_session_t *session)
| Returns the last error code.
const char * | irc_strerror (int ircerrno)
| Returns the text error message associated with this error code.

## Function Documentation

int irc_errno | ( | irc_session_t * | session | ) |

Returns the last error code.

Parameters:

  | session | An initiated session.

This function returns the last error code associated with last operation of this IRC session. Possible error codes are defined in libirc_errors.h

As usual, next errno rules apply:

- irc_errno() should be called ONLY if the called function fails;
- irc_errno() doesn't return 0 if function succeed; actually, the return value will be undefined.
- you should call irc_errno() IMMEDIATELY after function fails, before calling any other libircclient function.

See also:
  irc_strerror

const char * irc_strerror | ( | int | ircerrno | ) |

Returns the text error message associated with this error code.

Parameters:

  | ircerrno | A numeric error code returned by irc_errno()

This function returns the text representation of the given error code.

See also:
  irc_errno()