glfw: need a way to get error descriptions #144

Closed
opened 2021-12-24 08:41:51 +00:00 by emidoots · 0 comments
emidoots commented 2021-12-24 08:41:51 +00:00 (Migrated from github.com)

@AliChraghi brought up a really good point in the Matrix chat: mach/glfw currently eats error descriptions, and sometimes GLFW's error types are not sufficient to debug the cause:

image

github.com/hexops/mach@38cab2e423/glfw/src/errors.zig (L125)

currently we are just calling glfwGetError and we pass in a null pointer for the description, so GLFW doesn't give it to us.

Open questions:

  • What level of detail is in GLFW error descriptions? Specifically of concern would be if Zig GLFW apps in the wild could produce these errors and we would need such error descriptions from users in order to debug the cause..
  • Is there a sane way we could return error messages with errors? Should we?
  • Would a debug option (env var?) be better? e.g. when set, print error descriptions to stderr.
@AliChraghi brought up a really good point in the Matrix chat: `mach/glfw` currently eats error descriptions, and sometimes GLFW's error types are not sufficient to debug the cause: <img width="754" alt="image" src="https://user-images.githubusercontent.com/3173176/147335540-a4e225fc-7191-43e2-92ad-accc7c69d47e.png"> https://github.com/hexops/mach/blob/38cab2e423b14bb1c8a6273a9387be6b0f9d6c38/glfw/src/errors.zig#L125 currently we are just calling glfwGetError and we pass in a null pointer for the description, so GLFW doesn't give it to us. Open questions: * What level of detail is in GLFW error descriptions? Specifically of concern would be if Zig GLFW apps in the wild could produce these errors and we would need such error descriptions from users in order to debug the cause.. * Is there a sane way we could return error messages with errors? Should we? * Would a debug option (env var?) be better? e.g. when set, print error descriptions to stderr.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
hexops/mach#144
No description provided.