move sp_error_message into a high level library module