2shady4u / godot-sqlite

GDExtension wrapper for SQLite (Godot 4.x+)
MIT License
975 stars 83 forks source link

When error occurs, print out path where in the code the issue occurred/increase verbosity #185

Open ibutab opened 2 months ago

ibutab commented 2 months ago

Is your feature request related to a problem? Please describe. I'm making a game with lots of different queries, this makes it difficult to have verbosity on (if I'm not developing a specific query). Sometimes I get errors, e.g "--> SQL error: NOT NULL constraint failed: horse_training.ht_effort". In some cases I can't even turn on vebosity, because the Godot console would stop printing. The issue is that I have multiple different functions that can have a query with similar stuff, this makes it very hard to backtrack where the issue is.

Describe the solution you'd like I would like to in someway, when there is an error, be able to increase verbosity or more easily find out where the query originated from. So say --> SQL error: NOT NULL constraint failed: horse_training.ht_effort. Query origination: script path, line number".

Describe alternatives you've considered Have not considered alternatives.

ibutab commented 2 months ago

@2shady4u

2shady4u commented 2 months ago

Hello @ibutab,

This should be doable by using the push_error()-method which automatically adds this information to the error message in Godot itself. Unfortunately, I currently don't have time to work on this enhancement... 😢 I'll try to get back to this issue once I have time again.

ibutab commented 2 months ago

Ok, no problem. I'll see what I can do with push error 👍 @2shady4u