Fixed #22058 -- Refactored handlers and added a general mechanism to deal with client and server errors.

**What is done**:

- Refactored handlers into generic ones.
- Deprecated original default views.
- Added generic views.

**Improvements**:
- Docs build have several warnings due to removing original handlers.
- A writeup for new views.

**Suggestions**:
- We could add two generic exceptions also: `HttpClientException` and `HttpServerException` to add onto the functionality.

This was for whole but since I had shifted the logging to separate function, so in order to prevent it from being logged twice, I moved this inside.