nom-sql icon indicating copy to clipboard operation
nom-sql copied to clipboard

Improve error handling

Open lovasoa opened this issue 7 years ago • 4 comments

Currently, when parse fails, the user only gets a very uninformative error string as a result. It would be nice to have a custom error type with useful functionality , such as knowing where the error happened.

lovasoa avatar Sep 19 '18 16:09 lovasoa

See https://github.com/lovasoa/nom-sql/commit/a0e27acb812da12e9ca9d65f3f97dd169e82f7d7

lovasoa avatar Sep 19 '18 16:09 lovasoa

Yes! I've been meaning to add support for more descriptive syntax errors for a while, but never got around to it. Independently, I believe nom's story for parse error handling has also changed, however, so it might be best do to this alongside a port to nom v4.

ms705 avatar Oct 03 '18 22:10 ms705

(Though I like the changed you linked; we can certainly merge that one right away.)

ms705 avatar Oct 03 '18 22:10 ms705

To add to this issue: Specifically we should use nom's VerboseError to improve error messages. One thing pointed out by @spazm is that in src/create.rs, the creation function, might want to through a nom error with descriptive error message rather than the existing assert!(table.alias.is_none())

tomharmon avatar Feb 03 '20 15:02 tomharmon