Skip to content

Bug: Fix surfaceError method in the new product registration - stack trace swallowed #17405

@aalves08

Description

@aalves08

Setup

  • Rancher version: n/a
  • Rancher UI Extensions: n/a
  • Browser type & version: n/a

Describe the bug

We're swallowing the stack trace. So the error is good but doesn't help developers work out where in code the error is.

surfaceError method should be:

 private surfaceError(message: string, e: any): never {
    console.error(`Resource API error - ${ this.storeType } - ${ message }`); // eslint-disable-line no-console
    throw new Error(`Resource API error - ${ this.storeType } - ${ message }`, { cause: e });
  }

and we should update all usages in the new product registration API

To Reproduce

Result
as per description

Expected Result

as per description

Screenshots

Additional context

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions