Feature #739

Implement errors code and categories

Added by David Demelier 8 months ago. Updated 8 months ago.

Status:ClosedStart date:11/27/2017
Priority:NormalDue date:
Assignee:David Demelier% Done:

100%

Category:IrccdEstimated time:4.00 h
Target version:3.0.0Spent time:8.00 h
MFD after: Bookmark:@
MFD revision: Submitted by:
Branch:default

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 8 months ago

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

Also available in: Atom PDF