Skip to content

Commit

Permalink
Merge 2b1dbd2 into 43812f4
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Feb 16, 2019
2 parents 43812f4 + 2b1dbd2 commit abc1512
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions masonite/exception_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def handle(self, exception):
self.response.view(self._app.make('View')('/masonite/snippets/exception',
{
'exception': self._exception,
'split_exception': str(self._exception).split(' '),
'traceback': traceback,
'tb': sys.exc_info(),
'app': self._app,
Expand Down
3 changes: 3 additions & 0 deletions masonite/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def view(self, view, status=200):
elif view is None:
raise ResponseError('Responses cannot be of type: None.')

if not isinstance(view, str):
raise ResponseError('Invalid response type of {}'.format(type(view)))

self.app.bind('Response', view)

self.make_headers()
Expand Down
2 changes: 2 additions & 0 deletions masonite/snippets/exception.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<li><a href="#Request">Request</a></li>
<li><a href="#Container">Container</a></li>
<li><a href="{{ app.make('Request').path }}">Try Again</a></li>
<li><a href="https://stackoverflow.com/search?q=masonite+{{ split_exception|join('+') }}" target="_blank"><img src="/_exceptions/css/so-icon.png" style="width: 20px" /> Stack Overflow</a></li>
<li><a href="https://www.google.com/search?q=masonite+{{ split_exception|join('+') }}" target="_blank"><img src="/_exceptions/css/go-icon.png" style="width: 20px" /> Google</a></li>
</ul>
</div>
</div>
Expand Down
Binary file added masonite/snippets/exceptions/css/go-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added masonite/snippets/exceptions/css/so-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit abc1512

Please sign in to comment.