Skip to content

Conversation

@mitchell-as
Copy link
Collaborator

@mitchell-as mitchell-as commented Feb 10, 2025

StoryDX-3210 For non user-facing input errors we report an error ID

Sample:

% state checkout org/project
█ Something Went Wrong

 x Command failed due to unexpected error. For your convenience, this is the error chain:
  oops!.

█ Need More Help?
 • Run → 'state checkout --help' for general help.
 • Ask For Help → https://community.activestate.com/c/state-tool/
   When doing so, please reference the following error ID: 90cb6932.

Note the last line of output.

@github-actions github-actions bot changed the base branch from master to version/0-48-0-RC1 February 10, 2025 19:55
errorMsg := err.Error()
if IsReportableError(err) {
multilog.Critical("Returning error:\n%s\nCreated at:\n%s", errs.JoinMessage(err), stack)
multilog.Critical("Returning error (ID: %s):\n%s\nCreated at:\n%s", getErrorId(), errs.JoinMessage(err), stack)
Copy link
Collaborator Author

@mitchell-as mitchell-as Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will call rollbar.Critical, which forwards our message and error ID to rollbar:

rollbar.Critical(format, args...)


// Returns a relatively unique ID for error reporting.
// We report this ID in non-user-facing errors and on Rollbar so we can cross-reference them.
// Repeated calls return the same ID.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine because there can only ever be one error we report to the user that we'd have to lookup on Rollbar.


var errorId string

// Returns a relatively unique ID for error reporting.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need a totally unique ID, just something to search for in Rollbar to find the user's log.

@mitchell-as mitchell-as requested a review from SkyLeite February 11, 2025 20:20
@mitchell-as mitchell-as marked this pull request as ready for review February 11, 2025 20:20
@mitchell-as mitchell-as merged commit a83b45c into version/0-48-0-RC1 Feb 12, 2025
9 checks passed
@mitchell-as mitchell-as deleted the mitchell/dx-3210 branch February 12, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants