Skip to content

Structured exceptions for Moose #38

Merged
merged 685 commits into from Oct 18, 2013

5 participants

@Sweet-kid
Moose member

No description provided.

Sweet-kid added some commits Aug 10, 2013
@Sweet-kid Sweet-kid Wrote tests for ConflictDetectedInCheckRoleExclusionsInToClass & Clas…
…sDoesTheExcludedRole
9007b36
@Sweet-kid Sweet-kid Wrote ConflictDetectedInCheckRoleExclusionsInToClass & ClassDoesTheEx…
…cludedRole
bb435f7
@Sweet-kid Sweet-kid removed ->throw_error (forgot to remove earlier) e74eb7d
@Sweet-kid Sweet-kid removed whitespace 7d2f016
@Sweet-kid Sweet-kid replaced throw_error with throw_exception 94b81f9
@Sweet-kid Sweet-kid Wrote tests for CannotCreateMethodAliasLocalMethodIsPresentInClass f6b1e5b
@Sweet-kid Sweet-kid Wrote exception CannotCreateMethodAliasLocalMethodIsPresentInClass 04194d7
@Sweet-kid Sweet-kid passed as an attribute to the exception 4a7c1e3
@Sweet-kid Sweet-kid Wrote tests for second_role attribute to RoleDoesTheExcludedRole 6579d45
@Sweet-kid Sweet-kid Added second_role attribute to RoleDoesTheExcludedRole 4f3f23f
@Sweet-kid Sweet-kid replaced = ... with throw_exception d8fc5cb
@Sweet-kid Sweet-kid Wrote tests for MethodNameConflictInRoles da60c77
@Sweet-kid Sweet-kid Wrote exception class MethodNameConflictInRoles 3507bc1
@Sweet-kid Sweet-kid committed ConflictDetectedInCheckRoleExclusionsInToClass (forgot to c…
…ommit earlier)
20d004f
@Sweet-kid Sweet-kid replaced confess with throw_exception fb1eca5
@Sweet-kid Sweet-kid Wrote tests for NoImmutableTraitSpecifiedForClass & IncompatibleMetac…
…lassOfSuperclass
162245c
@Sweet-kid Sweet-kid Wrote NoImmutableTraitSpecifiedForClass & IncompatibleMetaclassOfSupe…
…rclass
63f8021
@Sweet-kid Sweet-kid replaced (die|throw_error|confess) with throw_exception 16799a7
@Sweet-kid Sweet-kid Wrote tests for exceptions in Moose::Meta::Attribute::Native::Trait c2413ec
@Sweet-kid Sweet-kid Wrote exceptions for Moose::Meta::Attribute::Native::Trait 8989b4c
@Sweet-kid Sweet-kid Removed redundant use Carp 'confess' 409eb06
@Sweet-kid Sweet-kid Removed whitespace 8ba1a3c
@Sweet-kid Sweet-kid consumed TypeConstraint role & used attribute predicate ad7ad88
@Sweet-kid Sweet-kid added predicate to 'attribute' 246466d
@Sweet-kid Sweet-kid replaced throw_error with throw_exception e27c178
@Sweet-kid Sweet-kid Wrote tests for exceptions in Moose::Meta::TypeConstraint d4d5bb5
@Sweet-kid Sweet-kid replaced throw_error with throw_exception & removed use Carp qw(confess) 5828174
@Sweet-kid Sweet-kid Wrote exception classes for Moose::Meta::TypeConstraint 9418908
@Sweet-kid Sweet-kid Wrote tests for exceptions in string replace method 84bffdb
@Sweet-kid Sweet-kid removed trailing whitespace d55db67
@Sweet-kid Sweet-kid Replaced _inline_throw_error with _inline_throw_exception 15f3058
@Sweet-kid Sweet-kid Wrote exception InvalidArgumentToMethod b5efc1c
@Sweet-kid Sweet-kid replaced _inline_throw_error with _inline_throw_exception 835ab62
@Sweet-kid Sweet-kid Wrote tests for string substr method a50c018
@Sweet-kid Sweet-kid Wrote tests for string match method 6fbd2c3
@Sweet-kid Sweet-kid replaced _inline_throw_error with _inline_throw_exception 6622604
@Sweet-kid Sweet-kid Wrote tests for exceptions in Moose::Meta::Method::Accessor::Native 5d5bdc8
@Sweet-kid Sweet-kid replaced _inline_throw_error with _inline_throw_exception c49026b
@Sweet-kid Sweet-kid Wrote exception classes for Moose::Meta::Method::Accessor::Native ce04d86
@Sweet-kid Sweet-kid Wrote tests for exceptions in Moose::Meta::TypeConstraint::Parameterized b4ff629
@Sweet-kid Sweet-kid replaced throw_error with throw_exception 1d87cc7
@Sweet-kid Sweet-kid removed trailing whitespace a5bb199
@Sweet-kid Sweet-kid Wrote exceptions classes for Moose::Meta::TypeConstraint::Parameterized d551a0c
@Sweet-kid Sweet-kid Wrote tests for exceptions in Moose::Util::MetaRole 52d5f4d
@Sweet-kid Sweet-kid replaced croak with throw_exception 899f92d
@Sweet-kid Sweet-kid Wrote exception classes for Moose::Util::MetaRole 1a8a37a
@Sweet-kid Sweet-kid replaced confess with throw_exception 9e635ad
@Sweet-kid Sweet-kid Wrote tests for CodeBlockMustBeACodeRef f7223b7
@Sweet-kid Sweet-kid Wrote exception class CodeBlockMustBeACodeRef adeca27
@Sweet-kid Sweet-kid replaced throw_error with throw_exception ecec59b
@Sweet-kid Sweet-kid Wrote tests for exceptions in Moose::Meta::Method::Delegation ebeccbd
@Sweet-kid Sweet-kid Wrote exception classes AttributeValueIsNot(Defined|AnObject) aa048c4
@Sweet-kid Sweet-kid wrote tests for exceptions in Moose::Meta::Role::Application::ToClass 14d04f5
@Sweet-kid Sweet-kid replaced throw_error with throw_exception 0184a96
@Sweet-kid Sweet-kid Wrote exception classes for Moose::Meta::Role::Application::ToClass 8208026
@Sweet-kid Sweet-kid Removed whitespace 55a5947
@Sweet-kid Sweet-kid Wrote exception class TypeConstraintCannotBeUsedForAParameterizableType c8a45da
@Sweet-kid Sweet-kid used throw_exception & _inline_throw_exception 59b3b9a
@Sweet-kid Sweet-kid Wrote tests for exceptions in Moose::Meta::Attribute a335db4
@Sweet-kid Sweet-kid Wrote exception classes for Moose::Meta::Attribute f73ebb0
@Sweet-kid Sweet-kid replaced confess with throw_exception a33ca37
@Sweet-kid Sweet-kid Wrote tests for NoDestructorClassSpecified 54b5588
@Sweet-kid Sweet-kid Wrote exception class NoDestructorClassSpecified 5cc0f1d
@Sweet-kid Sweet-kid replaced _inline_throw_error with _inline_throw_exception 75da97e
@Sweet-kid Sweet-kid Wrote method _inline_throw_exception 51a7232
@Sweet-kid Sweet-kid Wrote tests for CannotAssignValueToReadOnlyAccessor 2c560da
@Sweet-kid Sweet-kid Wrote exception CannotAssignValueToReadOnlyAccessor a64df02
@Sweet-kid Sweet-kid replaced Moose::Meta::Class with Class::MOP::Class 5b67ff6
@Sweet-kid Sweet-kid replaced _inline_throw_error with _inline_throw_exception 573c253
@Sweet-kid Sweet-kid replaced _inline_throw_error with _inline_throw_exception e831153
@Sweet-kid Sweet-kid Wrote tests for exceptions in Moose::Meta::Method::Accessor::Native::…
…Array
3446640
@Sweet-kid Sweet-kid replaced _inline_throw_error with _inline_throw_exception 028f40d
@Sweet-kid Sweet-kid Made ValidationFailedForInlineTypeConstraint usable for one more exce…
…ption

As of now, this exception has this message:
 "Attribute (".$self->attribute_name.") does not pass the type constraint because: ".$self->type_constraint_message;

and it can be used by one more exception with this message:
"A new member value for ".$self->attribute_name." does not pass its type constraint because: "
b93e65c
@Sweet-kid Sweet-kid Wrote tests for exceptions in Moose::Meta::Method::Accessor::Native::…
…Collection
bd61b3f
@Sweet-kid Sweet-kid replaced _inline_throw_error with _inline_throw_exception 255d38f
@Sweet-kid Sweet-kid Wrote tests for exception in Moose::Meta::Method::Accessor::Native::Hash 13bcabd
@Sweet-kid Sweet-kid Replaced _inline_throw_error with _inline_throw_exception d9eeb23
@Sweet-kid Sweet-kid Wrote tests for exceptions in Moose::Meta::Method::Accessor::Native::…
…Hash::set
3bc76cc
@Sweet-kid Sweet-kid Wrote exceptions for Moose::Meta::Method::Accessor::Native::Hash::set c3d6e93
@Sweet-kid Sweet-kid Made either attribute or attribute_name is optional
As of now, this exception uses InvalidAttributeOptions Role for attribute_name, but there are some exceptions which has attribute instance besides attribute_name, so for making this exception more informative, I have added attribute which isa Class::MOP::Attribute.
82cb857
@Sweet-kid Sweet-kid fixed indentation & removed whitespace e1f129d
@Sweet-kid Sweet-kid Added documentation to trace & message 77b142c
@Sweet-kid Sweet-kid Do not use auto_deref, because it is borken 38ffefe
@Sweet-kid Sweet-kid replaced confess with throw_exception 4d249b1
@Sweet-kid Sweet-kid Wrote exception CannotMakeMetaclassCompatible 863ccb9
@Sweet-kid Sweet-kid shortened exception name 7268159
@Sweet-kid Sweet-kid Made OverrideConflictInComposition compatible with two exceptions e126552
@Sweet-kid Sweet-kid replaced throw_error with throw_exception f03a748
@Sweet-kid Sweet-kid Changed exception name baed192
@Sweet-kid Sweet-kid Wrote tests for OverrideConflictInComposition 7baef16
@Sweet-kid Sweet-kid Wrote tests for Moose::Meta::Role::Application::RoleSummation 3e8de8a
@Sweet-kid Sweet-kid replaced throw_error with throw_exception a25c043
@Sweet-kid Sweet-kid Wrote exceptions for Moose::Meta::Role::Application::RoleSummation 7273212
@Sweet-kid Sweet-kid Made changes in tests documentation generator 28c84b3
@Sweet-kid Sweet-kid Use CannotMakeMetaclassCompatible for all metaclass compatibility exc…
…eptions
db6035a
@Sweet-kid Sweet-kid removed TODO test which is passing now 5f8b99d
@Sweet-kid Sweet-kid replaced die with throw_exception 6b4d120
@Sweet-kid Sweet-kid Wrote tests for PackageDoesNotUseMooseExporter 4611430
@Sweet-kid Sweet-kid Wrote PackageDoesNotUseMooseExporter 61a7c55
@Sweet-kid Sweet-kid Replaced throw_error with die (Not a structured exception) e0dfdd9
Sweet-kid added some commits Sep 15, 2013
@Sweet-kid Sweet-kid fixed indentation 9a56db8
@Sweet-kid Sweet-kid removed redundant delegation methods 88280c2
@Sweet-kid Sweet-kid Wrote EitherAttributeOrAttributeName
Some exceptions take either attribute or attribute_name or both,
so I have written this role for such exceptions
01dd0c8
@Sweet-kid Sweet-kid Used EitherAttributeOrAttributeName role 5afe1a9
@Sweet-kid Sweet-kid replaced confess with throw_exception 3ca398b
@Sweet-kid Sweet-kid Wrote tests for CannotAssignValueToReadOnlyAccessor 818cb34
@Sweet-kid Sweet-kid used EitherAttributeOrAttributeName role 2527869
@Sweet-kid Sweet-kid used IncompatibleMetaclassOfSuperclass
changing exception message is not recommended, it may lead to some tests failiures, so using IncompatibleMetaclassOfSuperclass
4aaacb0
@Sweet-kid Sweet-kid changed tests for IncompatibleMetaclassOfSuperclass a1174b7
@Sweet-kid Sweet-kid Wrote IncompatibleMetaclassOfSuperclass 6ae7169
@Sweet-kid Sweet-kid replaced confess with throw_exception 74eb02e
@Sweet-kid Sweet-kid Wrote metaclass incompatibility exceptions for Class::MOP::Class 2efad6e
@Sweet-kid Sweet-kid Wrote tests for metaclass compatibility exceptions of Class::MOP::Class a84dd00
@Sweet-kid Sweet-kid replaced confess with throw_exception & minor modification in _anon_c…
…ache_key
0d78324
@Sweet-kid Sweet-kid Wrote exception PackagesAndModuleAreNotCachable f1b088f
@Sweet-kid Sweet-kid Wrote tests for exception PackagesAndModuleAreNotCachable 4518133
@Sweet-kid Sweet-kid replaced confess with throw_exception & minor modification in _anon_c…
…ache_key
5ff4c79
@Sweet-kid Sweet-kid Wrote tests for exception PackagesAndModuleAreNotCachable 0c32806
@Sweet-kid Sweet-kid Using role EitherAttributeOrAttributeName,so removed the redundant code ee407e1
@Sweet-kid Sweet-kid replaced die & throw_error with throw_exception 6a2d052
@Sweet-kid Sweet-kid Wrote exceptions for Moose::Exporter ba9213d
@Sweet-kid Sweet-kid wrote tests for exceptions in Moose::Exporter 1580ee0
@Sweet-kid Sweet-kid replaced throw_error with throw_exception 3255177
@Sweet-kid Sweet-kid Wrote tests for UnableToRecognizeDelegateMetaclass 607e56a
@Sweet-kid Sweet-kid wrote UnableToRecognizeDelegateMetaclass b1c06a5
@Sweet-kid Sweet-kid replaced confess with throw_exception b665028
@Sweet-kid Sweet-kid replaced throw_error with throw_exception 8c7961d
@Sweet-kid Sweet-kid wrote tests for CouldNotParseType 512b322
@Sweet-kid Sweet-kid wrote CouldNotParseType f2631f7
@Sweet-kid Sweet-kid Replaced throw_error with confess(not a structured exception) f118659
@Sweet-kid Sweet-kid removed trailing whitespace 03a3d2d
@Sweet-kid Sweet-kid Wrote documentation generator for documenting exception classes aae6bd9
@Sweet-kid Sweet-kid replaced throw_error with confess (not a structured exception) dcc11b9
@Sweet-kid Sweet-kid replaced throw_error with confess (not a structured exception) 88b6f4b
@Sweet-kid Sweet-kid Removed extra line 2037a24
@Sweet-kid Sweet-kid renamed package_or_module to is_module dff6541
@Sweet-kid Sweet-kid Renamed package_or_module to is_module & made it Bool 4835932
@Sweet-kid Sweet-kid Removed redundant code (moved it in the exception) 581d8c8
@Sweet-kid Sweet-kid Renamed package_or_module to is_module c88966e
@Sweet-kid Sweet-kid removed whitespace 1af54c4
@Sweet-kid Sweet-kid replaced throw_error with throw_exception c9fdf0e
@Sweet-kid Sweet-kid Wrote exception CouldNotEvalCreateWriter 0b10428
@Sweet-kid Sweet-kid Changed type of error, error isa Str|Moose::Exception
This exception can have CouldNotCreateWriter as an error, so error should be 'Str|Moose::Exception'
e20cae1
@Sweet-kid Sweet-kid Wrote tests for CouldNotCreateWriter d7f82fe
@Sweet-kid Sweet-kid Removed data which I added by mistake 201a73a
@Sweet-kid Sweet-kid deleted moose-meta-method-accessor.t 5c7c098
@Sweet-kid Sweet-kid Wrote tests for CouldNotCreateWriter c44e846
@Sweet-kid Sweet-kid Replaced confess with throw_exception 4887c37
@Sweet-kid Sweet-kid Wrote tests for CouldNotEvalConstructor 41ee898
@Sweet-kid Sweet-kid Wrote exception CouldNotEvalConstructor 4db6b35
@Sweet-kid Sweet-kid removed reftype while merging conflicts, so added refype 6cd9dee
@Sweet-kid Sweet-kid get rid of warning due to undefined {body} 33e8bad
@Sweet-kid Sweet-kid get rid of deprecated hand-optimized type constraint ccb84a1
@Sweet-kid Sweet-kid load Class::MOP at runtime,to prevent circular dependency 14a17a3
@Sweet-kid Sweet-kid lost this while resolving merge conflicts ee666e5
@Sweet-kid Sweet-kid Pass ARRAY ref to enum a82cb89
@Sweet-kid Sweet-kid Pass ARRAY ref to enum 83bdde5
@Sweet-kid Sweet-kid This exception has been replaced by MustPassEvenNumberOfAttributeOptions 48c66fc
@Sweet-kid Sweet-kid replaced InvalidHasProvided by MustPassEvenNumberOfAttributeOptions 4357734
@Sweet-kid Sweet-kid replaced throw_error with throw_exception 1293a34
@Sweet-kid Sweet-kid removed tests for InvalidHasProvided f714b10
@Sweet-kid Sweet-kid Wrote tests for exceptions in Moose::Meta::Attribute 5a1fbb2
@Sweet-kid Sweet-kid Wrote CannotCoerceAttributeWhichHasNoCoercion for Moose::Meta::Attribute c968ffc
@Sweet-kid Sweet-kid Corrected exception message f2e637c
@Sweet-kid Sweet-kid replaced throw_error with throw_exception 5a567aa
@Sweet-kid Sweet-kid Wrote tests for exception in Moose::Util b32c886
@Sweet-kid Sweet-kid Wrote exception CannotLocatePackageInINC for Moose::Util e7b932d
@Sweet-kid Sweet-kid shortened method_constructor_object to constructor_method 2f1b06f
@Sweet-kid Sweet-kid Wrote a comment for intention syntax error f7a8234
@Sweet-kid Sweet-kid attribute_name can be fetched from attribute,so no need to pass attri…
…bute_name
2a86211
@Sweet-kid Sweet-kid get rid of load_class & is_class_loaded 643ea45
@Sweet-kid Sweet-kid Added one more attribute(class) to ExtendsMissingArgs 9b2e07a
@Sweet-kid Sweet-kid Removed redundant throw_error & _inline_throw_error e68e094
@Sweet-kid Sweet-kid Made changes for getting exception message of CouldNotCreateWriter
documentation generator was unable to fetch exception message of CouldNotCreateWriter,
because it's thrown by another exception (CouldNotGenerateInlineAttributeMethod) unlike
other exceptions
0c1d874
@Sweet-kid Sweet-kid Wrote documentation of Moose::Exception 5f96079
@Sweet-kid Sweet-kid Removed redundant use Class::Load 0.07 qw(load_class); 4c16588
@Sweet-kid Sweet-kid Wrote documentation of Moose::Util::throw_exception cb68300
@Sweet-kid Sweet-kid Made type a duck-type, because of Specio, Type::Tiny etc. 344c5f7
@Sweet-kid Sweet-kid Made changes in documentation 4049a5f
@Sweet-kid Sweet-kid find_meta should not load Class::MOP at runtime
Some tests were failing because of circular dependencies due to Moose::Util::throw_exception, so I loaded it at runtime.
c977ade
@Sweet-kid Sweet-kid Wrote documentation for Exceptions 318b705
@Sweet-kid Sweet-kid Made changes in Moose::Manual::Exceptions::Manifest 6347bd0
@Sweet-kid Sweet-kid Created Moose::Manual::Exceptions::Manifest.pod 240f183
@Sweet-kid Sweet-kid Made changes for removing trailing whitespace 02f26ba
@Sweet-kid Sweet-kid Adding documentation with removed trailing whitespace 9fa657a
@Sweet-kid Sweet-kid Added words to pod-spell.t e72c9cb
@Sweet-kid Sweet-kid Ignore docs of Moose::Exception::* modules & Moose::Exception::BUILD …
…function
966bf76
@Sweet-kid Sweet-kid fixed trailing whitespace & tabs 2ccc449
@Sweet-kid Sweet-kid enum should take an ARRAY ref f9d057b
@Sweet-kid Sweet-kid fixed trailing whitespace & pod syntax errors 0f3129b
@sartak sartak referenced this pull request Oct 18, 2013
Closed

Topic/structured exceptions #37

@karenetheridge
Moose member

\o/

If there are no objections from the cabal or peanut gallery, I can put this up as Moose-2.1101-TRIAL this weekend.

@doy doy merged commit 9fe161f into master Oct 18, 2013

1 check passed

Details default The Travis CI build passed
@doy
Moose member
doy commented Oct 18, 2013

@karenetheridge sounds good to me!

@kthakore

Wow! Just read Sartak's blog post about this! Great work sweet_kid!

@Sweet-kid
Moose member

Thank you @kthakore :)

@hesco
hesco commented Oct 21, 2013

Thank you so much. AN auspicious introduction to the community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.