replace call to PrintConsole with call to error()