update cat for current Rust syntax with ugly errors handling