Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Error messages could be a bit more explanatory #7

@kjleitz

Description

@kjleitz

I just got this output when trying to submit:

// ♥ learn submit
Adding changes...
Committing changes...
Sorry, something went wrong. Please try again.

I see in learn-submit/lib/learn_submit/submission/git_interactor.rb that there are the following lines (starting on line 114):

      def commit_changes
        puts 'Committing changes...'
        begin
          git.commit(message)
        rescue Git::GitExecuteError => e
          if e.message.match(/nothing to commit/)
            puts "It looks like you have no changes to commit. Will still try updating your submission..."
          else
            puts 'Sorry, something went wrong. Please try again.'
            exit 1
          end
        end
      end

The "Sorry, something went wrong. Please try again." line sort of obscures the issue. Could it instead (in addition to printing that line) print the contents of e.message? That way it might be easier to diagnose the problem.

That could also be done in the other areas where a similar message is printed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions