Tux / CSV

Text::CSV for the Raku Programming Language
Artistic License 2.0
13 stars 11 forks source link

Refactor exceptions #23

Open JJ opened 4 years ago

JJ commented 4 years ago

Right now it looks like...

my %errors =
    # Success
       0 => "",

    # Generic errors
    1000 => "INI - constructor failed", ...

We should probably make some attempt to automatize it, maybe generate X::Text::CSV::Ini names and then generate the message automatically. Refactoring the code, which looks like self!fail(%error<1000>) shouldn't be too difficult either.

Tux commented 4 years ago

This is a plain copy from Text::CSV_XS. If there is an easier way, I don't mind simplification. At least I think it should be easy to keep the two in sync as much as possible.

JJ commented 4 years ago

That might become eventually impossible... But if we can automatically convert it, I guess we could do it again...

El mar., 31 dic. 2019 a las 16:53, H.Merijn Brand (notifications@github.com) escribió:

This is a plain copy from Text::CSV_XS. If there is an easier way, I don't mind simplification. At least I think it should be easy to keep the two in sync as much as possible.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Tux/CSV/issues/23?email_source=notifications&email_token=AAAAD5B7FQYVVOZPYIDXX6DQ3NTGBA5CNFSM4KBUYKZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH4LYNI#issuecomment-569949237, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAD5D533ET3GOXOOBZ4J3Q3NTGBANCNFSM4KBUYKZA .

-- JJ

JJ commented 1 year ago

Also, usually exceptions use the X:: namespace; right now they don't even look like exceptions, using the name `CSV::Diag'