Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn OS error codes into strings #145

Open
lptr opened this issue Mar 18, 2020 · 1 comment
Open

Turn OS error codes into strings #145

lptr opened this issue Mar 18, 2020 · 1 comment
Milestone

Comments

@lptr
Copy link
Member

lptr commented Mar 18, 2020

Linux has strerror(), Windows has FormatMessage (see here). We should use these to turn error codes into strings when constructing our exceptions.

@wolfs wolfs added this to the 0.22 milestone May 7, 2020
@wolfs
Copy link
Member

wolfs commented May 7, 2020

We currently use strerror_r in other places:

void mark_failed_with_errno(JNIEnv* env, const char* message, jobject result) {
char* buffer = (char*) malloc(1024);
#if defined(__linux__) && _GNU_SOURCE
// GNU semantics
char* errno_message = strerror_r(errno, buffer, 1024);
#else
strerror_r(errno, buffer, 1024);
char* errno_message = buffer;
#endif
mark_failed_with_code(env, message, errno, errno_message, result);
free(buffer);
}

@lptr lptr modified the milestones: 0.22-M3, 0.22 Jun 4, 2020
@wolfs wolfs modified the milestones: 0.22-M4, 0.22 Jul 10, 2020
@wolfs wolfs modified the milestones: 0.22-M5, 0.22 Jul 17, 2020
@wolfs wolfs modified the milestones: 0.22-M8, 0.22 Aug 18, 2020
@wolfs wolfs modified the milestones: 0.22-milestone-9, 0.22 Nov 13, 2020
@wolfs wolfs modified the milestones: 0.22-M12, 0.22 Apr 20, 2021
@wolfs wolfs modified the milestones: 0.22-M17, 0.22 Jul 19, 2021
@wolfs wolfs modified the milestones: 0.22 M11, 0.22 Aug 9, 2021
@lptr lptr removed the @execution label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants