Skip to content

Commit

Permalink
updated ambiguous error
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Oct 18, 2019
1 parent b4395bd commit d978a80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion masonite/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__title__ = 'masonite'
__description__ = 'The core for the Masonite framework'
__url__ = 'https://github.com/MasoniteFramework/masonite'
__version__ = '2.2.22'
__version__ = '2.2.23'
__author__ = 'Joseph Mancuso'
__author_email__ = 'joe@masoniteproject.com'
__licence__ = 'MIT'
11 changes: 8 additions & 3 deletions masonite/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,19 @@ def _find_controller(self, controller):

# Set the controller method on class. This is a string
self.controller_method = mod[1]
except ImportError:
print('\033[93mCannot find controller {}. Did you create this one?'.format(get_controller), '\033[0m')
except ImportError as e:
import sys
import traceback
exc_type, _, exc_tb = sys.exc_info()
tb = traceback.extract_tb(exc_tb)[-1]
print('\033[93mCannot find controller {}. Did you create this one? Raised: {} in {} on line {}'.format(
get_controller, str(e), tb[0], tb[1]), '\033[0m')
except Exception:
import sys
import traceback
exc_type, _, exc_tb = sys.exc_info()
tb = traceback.extract_tb(exc_tb)[-1]
print('\033[93mWarning in routes/web.py!', exc_type, 'in', tb[0], 'on line', tb[1], '\033[0m')
print('\033[93mTrouble importing controller!', str(e), '\033[0m')

def get_response(self):
# Resolve Controller Constructor
Expand Down

0 comments on commit d978a80

Please sign in to comment.