Added stack trace to error handling in app-internal