raylib: [core] Errors are hidden in the Library and not getting up in the Application Layer
Issue description
As part of the simplification of the code, most functions are currently returning void as if they could not fail but in reality they are failing silently and only Log errors.
I would like to propose that the choice of what to do with an error could be left to the application developer.
for instance, in the last commit
it is not possible anymore to know if the function ChangeDirectory actually changed the directory or fail.
One more example in an other part of the API, with the InitWindow.
if i start the program without any environment the program Segfault without me possibly doing anything about it.
> env -i ./raylib
INFO: Initializing raylib 3.1-dev
WARNING: GLFW: Error: 65544 Description: X11: The DISPLAY environment variable is missing
WARNING: GLFW: Failed to initialize GLFW
INFO: TIMER: Target time per frame: 16.667 milliseconds
Segmentation fault (core dumped)
Please consider re-adding return value to the API.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 16 (14 by maintainers)
Commits related to this issue
- Exposing some file access results to user layer #1420 — committed to raysan5/raylib by raysan5 6 years ago
it’s not just beginners that want to stick to good programming practices…
On Sun, 22 Nov 2020 at 13:36, Nikolas notifications@github.com wrote:
–
blog bedroomcoders.co.uk http://bedroomcoders.co.uk
Disclaimer: By sending an email to ANY of my addresses you are agreeing that:
I am by definition, “the intended recipient”
All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please.
I may take the contents as representing the views of your company.
This overrides any disclaimer or statement of confidentiality that may be included on your message.
sorry are you really saying that I should teach using raylib as a bad design example ???
how about LoadModel LoadTexture etc ?