Update Cancel Billing & update billing to use status bounce rather than fatal
authoreileen <emcnaughton@wikimedia.org>
Mon, 18 Mar 2019 01:21:06 +0000 (14:21 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 18 Mar 2019 01:21:06 +0000 (14:21 +1300)
commit7a17438cc31e7a5ccb188699debd10a928da67f8
tree57b0214270a2aaf541f43203b5513902a67cdd27
parent49cfbaed65e6920698d83b57985df1eb228479a2
Update Cancel Billing & update billing to use status bounce rather than fatal

Per https://lab.civicrm.org/dev/core/issues/560 we have resolved to get rid of fatal & move
to throwing Exceptions.

However, I'm leaning towards making statusBounces the rules for when we just deem a form inaccessible.

In this case we have 3 paralel forms - cancel, update & a similar update but slightly different just cos.

One does a status bounce - 2 spit out fatals when access not available.

Just looking at Cancel these are the places that still have fatal

- The recurring contribution looks to have been cancelled already
- Required information missing

I'm not sure the value of a fatal as opposed to the gentler statusBounces in either of those cases.

Throwing an exception looks very much like a fatal except
1) it doesn't hurt tests or cli tools as much
2) IF display backtrace is enabled THEN the back trace displays.

so, it's generally better BUT I kinda feel like the only time when it's actually better than a status
bounce is when a bug has occurred (eg. an unexpectedly failed api call) - anything we anticipate
seems like a bounce to me....
CRM/Contribute/Form/CancelSubscription.php
CRM/Contribute/Form/UpdateBilling.php