Drupal 8: The proper alternative to exit(); for terminating a request Does anybody know how to avoid the brutal PHP built-in exit(); function and use the "right" Drupal 8 class method to terminate the request? If so: a bit explanation would be appreciated.
You would have been looking for drupal_exit() in the past, but this was removed in D8. It is now advised to use the appropriate HTTP Exception. See the example on the change notice:

https://www.drupal.org/node/2017339