patterns_io_save_pattern call primitive that returns the error msg