We could have error_code here be a pointer that defaults to NULL, so we avoid forcing the user to specify a value, if they don't care.