Returns error code and prints a error message if provided.
@protected int error(int code, {String? message}) { if (message != null) printError(message); return code; }