Whitespace
Flush output buffer before starting a new buffer
Add missing variable value
Remove unused catch at the request of @rossriley:

"The $app->redirect inside the catch can also go, originally i was going
to let the user try and remove but the occasions where it's stable
enough to do so were very few, so the fatal error was the best
solution."
Add reminder comment to explain reason for ob_end_flush()
Check the output buffer exists before flushing
Merge pull request #1662 from GawainLynch/hotfix/extension-error-handler

Hotfix/extension error handler