add nicer error message, if the 'type' is mistyped.
add error/warning methods