Usages of moldable exceptions in Glamorous Toolkit

This page gives example of Moldable exception used in Glamorous Toolkit.

AssertionFailure Error subclass: #AssertionFailure instanceVariableNames: '' classVariableNames: '' package: 'Kernel-Exceptions' defines a debugging configuration, that at the moment shows a diff view when two strings are being compared.

	assert: GtExampleComparisonExceptionWithDebuggingViews new
	equals: GtExampleComparisonExceptionWithDebuggingViews new

An AssertionFailure that does not involve a comporison does not trigger the error.

self assert: 1 = 2

GtPhlowViewTesterObjectValidationFailure GtPhlowViewTesterFailure subclass: #GtPhlowViewTesterObjectValidationFailure instanceVariableNames: 'object results' classVariableNames: '' package: 'GToolkit-Phlow-Examples-Tester' 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 GtPhlowViewTesterFailure subclass: #GtPhlowViewTesterViewValidationFailure instanceVariableNames: 'actualResult expectedResult' classVariableNames: '' package: 'GToolkit-Phlow-Examples-Tester' indicates that there is an error inside a single view of an object.

GtPhlowViewTester new 
	assertViewOk: (GtPhlowViewWithErrorExamples new 
		gtViewWithFailureInColumnedListFor: GtPhlowView empty)

GtPhlowViewsCollectorSameViewError GtPhlowViewsCollectorError subclass: #GtPhlowViewsCollectorSameViewError uses: TGtMoldableExceptionSignalWithTransformation instanceVariableNames: 'viewSelector targetObject' classVariableNames: '' package: 'GToolkit-DebuggerExtensions' is triggered when building a view if the same view that was given as parameter is returned.

viewBuilder := GtPhlowView empty. 
	basicOn: GtPhlowViewWithErrorExamples new 
	perform: #gtViewWithReturningSameViewFor:
	withArguments: {viewBuilder}.