Not all source strings are valid input to compile-str. Modify `compile` to handle the error and return the error if any.