Perhaps easier to call `error = output[/^ERROR: (.*)$/]` instead of these two lines?