Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Red throw it’s own exceptions #69

Closed
FCO opened this issue Dec 23, 2018 · 4 comments
Closed

Make Red throw it’s own exceptions #69

FCO opened this issue Dec 23, 2018 · 4 comments

Comments

@FCO
Copy link
Owner

FCO commented Dec 23, 2018

The drivers should map db exceptions to Red exceptions

@FCO
Copy link
Owner Author

FCO commented Dec 31, 2018

Changes every driver error to Red error. If the error is unknown (every one but the unique constraint error) throws this error (70eff5a#diff-b0a98c0d1d672c1c869329f86d65e76bR29) asking to open an issue about not existing that error.

@FCO
Copy link
Owner Author

FCO commented Dec 31, 2018

The error seems to be a rakudo bug.
This works:

MacBook-Pro-de-Fernando:Red2 fernando$ perl6 -Ilib t/10-alternate-relation-modules.t 
ok 1 - create table for Person
ok 2 - create table for Post
ok 3 - Create a Person
ok 4 - The object is-a 'Person'
ok 5 - and it is the person we expected
ok 6 - primary key is defined
ok 7 - and it is the value we expected
ok 8 - create a related post
ok 9 - The object is-a 'Post'
ok 10 - and the author-id of the post is the one we expected
ok 11 - post title is correct
ok 12 - post body is correct
1..12

but this doesn't:

MacBook-Pro-de-Fernando:Red2 fernando$ zef install . --force-install
===> Testing: Red:ver<0.0.1>
Incompatible MROs in P6opaque rebless for types Perl6::Metamodel::ParametricRoleGroupHOW and Stash
  in sub database at /Users/fernando/Documents/Projects/Red2/lib/Red/Database.pm6 (Red::Database) line 5
  in block <unit> at t/10-alternate-relation-modules.t line 20

===> Testing [FAIL]: Red:ver<0.0.1>
Aborting due to test failure: Red:ver<0.0.1> (use --force-test to override)
  in code  at /Users/fernando/.rakudobrew/moar-master/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 374
  in method test at /Users/fernando/.rakudobrew/moar-master/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 354
  in code  at /Users/fernando/.rakudobrew/moar-master/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 523
  in sub  at /Users/fernando/.rakudobrew/moar-master/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 520
  in method install at /Users/fernando/.rakudobrew/moar-master/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 621
  in sub MAIN at /Users/fernando/.rakudobrew/moar-master/install/share/perl6/site/sources/81436475BD18D66BFD96BBCEE07CCCDC0F368879 (Zef::CLI) line 152
  in block <unit> at /Users/fernando/.rakudobrew/moar-master/install/share/perl6/site/resources/D822DF07A6D5CB602F97ED307F62A1B3B5D2C90D line 3
  in sub MAIN at /Users/fernando/.rakudobrew/bin/../moar-master/install/share/perl6/site/bin/zef line 2
  in block <unit> at /Users/fernando/.rakudobrew/bin/../moar-master/install/share/perl6/site/bin/zef line 2

@jonathanstowe
Copy link
Contributor

That's odd. I'm guessing that it's something to do with the use lib 't/lib' in the t/10-alternate-relation-modules.t

Does:

diff --git a/t/10-alternate-relation-modules.t b/t/10-alternate-relation-modules.t
index c519ce3..e1e505e 100755
--- a/t/10-alternate-relation-modules.t
+++ b/t/10-alternate-relation-modules.t
@@ -8,7 +8,7 @@ use Test;
 
 use Red;
 
-use lib <t/lib>;
+use lib $*PROGRAM.parent.child('lib').Str;
 
 
 use Person;

help?

@FCO
Copy link
Owner Author

FCO commented Jan 1, 2019

Its working with the new rakudo version...

Now Red only throws its now exceptions, but it has only 3.
Ill create a new issue to create more exceptions as i find them, but ill close this one!

@FCO FCO closed this as completed Jan 1, 2019
@FCO FCO added this to backlog in Documenting Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants