Recover from panics in controllers. Return trace as body if debug=true, and log the trace if debug=false.