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

Conversation

codetheweb
Copy link
Contributor

Closes #30.

@seveibar does this look better or did you have something else in mind? .toString() now looks like:

SeamMalformedInputError: {␊
  "_errors": [],␊
  "device_id": {␊
    "_errors": [␊
      "Invalid uuid"␊
    ]␊
  }␊
}

@seambot
Copy link
Contributor

seambot commented Apr 11, 2022

⛔️ Javascript SDK tests failed.

@seveibar
Copy link
Contributor

seveibar commented Apr 11, 2022

Hmm I'm confused, I got the SeamMalformedInputError during an interview, and we had to spend a while debugging it, but your PR here shouldn't change the information that was displayed when the error was shown:

image

The line above the error line was a console.log that I added, and not actually part of the error. Is this because UnhandledPromiseRejection hides some of our errors? Or is this an error in our library? Sorry for the confusion

Another way to put this, if we have a UnhandledPromiseRejectionError should it show validation error details?

@codetheweb
Copy link
Contributor Author

Whoops, my bad--I see what you mean. How's this?

Screen Shot 2022-04-11 at 3 21 22 PM

(just logging the error object:

try {
   await client.devices.get({ device_id: "invalid-device-id" })
} catch (error) {
  console.error(error)
}

)

@seveibar
Copy link
Contributor

nice!!! yep perfect

@codetheweb codetheweb merged commit 2ec067c into main Apr 11, 2022
@codetheweb codetheweb deleted the feat-better-validation-error branch April 11, 2022 20:03
github-actions bot pushed a commit that referenced this pull request Apr 11, 2022
# [3.1.0](v3.0.0...v3.1.0) (2022-04-11)

### Features

* Merge pull request [#35](#35) from seamapi/feat-better-validation-error ([2ec067c](2ec067c))
@github-actions
Copy link

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MalformedInput error isn't helpful

3 participants