Update core.py

add reason in exception description