WIP: Improve register runner error handling

Open username-removed-1144264 requested to merge improvement/register-error-handling into master

What does this MR do?

Help users solve their problem when register runner receives an error from GitLab instance. Follow on to https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11690

Why was this MR needed?

Users have a hard time debugging when register runner fails.

Are there points in the code the reviewer needs to double check?

As is, my WIP commit is intended to output the JSON response directly.

I am not familiar with Go, so I wonder if we have some function/library/example that will format our Rails API validation error (the response looks like this)?

Or if it would be better to format the errors on the Rails side so it looks good when output as-is?

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Branch has no merge conflicts with master (if you do - rebase it please)

What are the relevant issue numbers?

Edited by username-removed-1144264