added message and code to error function