The line: handleCustomError(e.reason.message, e.reason.stack); fails because the "e" has no "reason" or "detail".