Skip to content

Commit

Permalink
updated error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Nov 2, 2023
1 parent 4372a14 commit 53b3d2d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
5 changes: 2 additions & 3 deletions cli/src/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,9 @@ function deployService(args: BuildReqArgs) {
lost: false,
})
if (services.length > 1)
throw new Error(`Multiple DeviceScript Managers found.`)
throw new Error(`Multiple DeviceScript device found.`)
else if (services.length == 0)
throw new Error(`No DeviceScript Managers found.`)

throw new Error(`No DeviceScript device found.`)
return services[0]
}

Expand Down
4 changes: 3 additions & 1 deletion interop/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ export const errors: Record<string, string> = {
"I2C device not found or malfunctioning": "i2c-device-not-found-or-malfunctioning",
"Unable to locate Node.JS v16+.": "terminal-nodemissing",
"Install @devicescript/cli package": "terminal-notinstalled",
"missing \"devicescript\" section": "missing-devicescript-section"
"missing \"devicescript\" section": "missing-devicescript-section",
"No DeviceScript device found.": "no-devicescript-device-found",
"Multiple DeviceScript device found.": "multiple-devicescript-device-found"
};
10 changes: 10 additions & 0 deletions website/docs/developer/errors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,13 @@ Importing a npm package designed for node.js or the browser is not yet supported
as the DeviceScript runtime environment is radically different from the browser or even node.js.

Instead you should try to import packages [specifically built for devicescript](/developer/packages/custom).

## No DeviceScript device found. {#no-devicescript-device-found}

DeviceScript is trying to deploy bytecode but it cannot find any connected DeviceScript device.
Make sure that your device is actively connected either through the connection helper page or through native transports (USB, Serial).

## Multiple DeviceScript device found. {#multiple-devicescript-device-found}

DeviceScript is trying to deploy bytecode but it found multiple connected DeviceScript devices. There should only be 1 connect device to deploy
or the tool will give up.

0 comments on commit 53b3d2d

Please sign in to comment.