Better error handling #1

Closed
opened 2022-06-29 18:29:45 +00:00 by uplime · 1 comment
Owner

Currently, there is no error handling with the exception of a semi-helpful error code. Even for my own personal projects this would be painful to work around.

The error should probably be a struct containing the following information:

#define GARGOYLE_MAX_ERR_SZ = 255;
#define GARGOYLE_MAX_FUNC_SZ = 32;

struct gargoyle_err {
  gargoyle_opt_type code;
  int errno;
  char func[GARGOYLE_MAX_FUNC_SZ];
  char errno_func[GARGOYLE_MAX_FUNC_SZ];
  char msg[GARGOYLE_MAX_ERR_SZ];
};

There should also be a utility function to print the error if the user does not want a custom format.

Currently, there is no error handling with the exception of a semi-helpful error code. Even for my own personal projects this would be painful to work around. The error should probably be a `struct` containing the following information: ```c #define GARGOYLE_MAX_ERR_SZ = 255; #define GARGOYLE_MAX_FUNC_SZ = 32; struct gargoyle_err { gargoyle_opt_type code; int errno; char func[GARGOYLE_MAX_FUNC_SZ]; char errno_func[GARGOYLE_MAX_FUNC_SZ]; char msg[GARGOYLE_MAX_ERR_SZ]; }; ``` There should also be a utility function to print the error if the user does not want a custom format.
uplime added the
enhancement
label 2022-06-29 18:29:45 +00:00
uplime self-assigned this 2022-06-29 18:29:46 +00:00
uplime added this to the Version 1.0.0 milestone 2022-06-29 19:16:01 +00:00
Author
Owner

gargoyle_digest_* now returns an error code and fills out gargoyle_err with the context of the failure. Fixed in 47332f3777 and b39bc46b50.

`gargoyle_digest_*` now returns an error code and fills out `gargoyle_err` with the context of the failure. Fixed in 47332f3777b500f0b78328156bf5e11952cf2791 and b39bc46b50ca59da317b12dbac96ed4e22fe444e.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: uplime/gargoyle#1
No description provided.