Usages of moldable exceptions in Glamorous Toolkit
This page gives example of Moldable exception used in Glamorous Toolkit.
AssertionFailure
defines a debugging configuration, that at the moment shows a diff view when two strings are being compared.
self assert: GtExampleComparisonExceptionWithDebuggingViews new expectedStringForTest equals: GtExampleComparisonExceptionWithDebuggingViews new computedStringForTest
An AssertionFailure that does not involve a comporison does not trigger the error.
self assert: 1 = 2
GtPhlowViewTesterObjectValidationFailure
is an assertion failure indicating that there is an error in the view of an object. See How to test phlow views for other examples of views with errors.
self assertObjectPhlowViewsFor: GtPhlowViewWithErrorExamples new.
GtPhlowViewTesterViewValidationFailure
indicates that there is an error inside a single view of an object.
GtPhlowViewTester new assertViewOk: (GtPhlowViewWithErrorExamples new gtViewWithFailureInColumnedListFor: GtPhlowView empty)
GtPhlowViewsCollectorSameViewError
is triggered when building a view if the same view that was given as parameter is returned.
viewBuilder := GtPhlowView empty. viewBuilder basicOn: GtPhlowViewWithErrorExamples new perform: #gtViewWithReturningSameViewFor: withArguments: {viewBuilder}.