pub fn error_to_error_code(msg: &str) -> Result<i32>