Project

General

Profile

Feature #739

Implement errors code and categories

Added by David Demelier about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
irccd
Target version:
Start date:
11/27/2017
Due date:
% Done:

100%

Estimated time:
4.00 h
Spent time:
MFD after:
MFD revision:
Branch:
default
Bookmark:
@
Platform:

Description

Add error code and categories for a better report especially for the network API.

The current designed codes:

/**
 * \brief General irccd errors (1-999).
 */
enum class irccd_errc {
    //!< No error.
    no_error = 0

    //!< The connected peer is not irccd.
    not_irccd,

    //!< The irccd version is too different.
    incompatible_version,

    //!< Authentication was required but not issued.
    auth_required,

    //!< Authentication was invalid.
    invalid_auth,

    //!< The message was not a valid JSON object.
    invalid_message,

    //!< The message requires more arguments.
    incomplete_message
};

/**
 * \brief Server management errors (1000-1999).
 */
enum class server_errc {
public:
    //!< No error.
    no_error = 0,

    //!< The specified server was not found.
    not_found = 1000,

    //!< The specified identifier is invalid.
    invalid_identifier,

    //!< The server is not connected.
    not_connected,

    //!< The server is already connected.
    already_connected,

    //!< The specified port number is invalid.
    invalid_port_number,

    //!< The specified reconnect tries number is invalid.
    invalid_reconnect_tries_number,

    //!< The specified reconnect reconnect number is invalid.
    invalid_reconnect_timeout_number,

    //!< The specified host was invalid.
    invalid_host,

    //!< SSL was requested but is disabled.
    ssl_disabled,
};

/**
 * \brief Plugin management errors (2000-2999).
 */
enum class plugin_errc {
    //!< No error.
    no_error = 0,

    //!< The specified plugin is not found.
    not_found = 2000,

    //!< The plugin was unable to run.
    exec_error,

    //!< The plugin is already loaded.
    already_exists,
};

History

#1

Updated by David Demelier about 1 year ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

Also available in: Atom PDF