RUBY-842 populate error code when using write commands