Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Error Handling for Device Mode Checks #715

Merged
merged 3 commits into from Jan 30, 2024

Conversation

keeramis
Copy link
Contributor

Description

This was the issue:

particle.js usb list
DeviceProtectionError
    at errorForRequest (/home/monkbroc/Programming/cli/node_modules/particle-usb/src/result.js:144:10)
    at /home/monkbroc/Programming/cli/node_modules/particle-usb/src/device.js:917:11
    at async klass.getDeviceMode (/home/monkbroc/Programming/cli/node_modules/particle-usb/src/device.js:352:13)
    at async Promise.all (index 2)
    at async /home/monkbroc/Programming/cli/src/lib/utilities.js:153:18
    at async CLI.runCommand (/home/monkbroc/Programming/cli/src/app/cli.js:148:4)
    at async CLI.run (/home/monkbroc/Programming/cli/src/app/cli.js:175:11) {
  result: 'Device is protected'
}

Propagate device protection error gracefully from the particle-usb

How to Test

Run npm start -- usb list on a bunch of devices with at least one protected device among them
Run npm start -- flash --local tinker

Related Issues / Discussions

N/A

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA
  • Problem and solution clearly stated
  • Tests have been provided
  • Docs have been updated
  • CI is passing

@keeramis keeramis changed the title Implement Error Handling for Device Mode Retrieval Add Error Handling for Device Mode Checks Jan 30, 2024
@keeramis keeramis force-pushed the fix/throw-correct-error-from-protected-devices branch from 0c36076 to 483acd5 Compare January 30, 2024 18:16
@keeramis keeramis marked this pull request as ready for review January 30, 2024 19:15
@keeramis keeramis merged commit 9be3030 into master Jan 30, 2024
6 checks passed
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.

None yet

2 participants