mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-24 04:55:44 +00:00
Merge pull request #2557 from balena-io/surface-sdk-incompatible-dt-errors
Surface sdk incompatible dt errors
This commit is contained in:
commit
37c6ad855b
@ -177,7 +177,16 @@ const messages: {
|
||||
Looks like the session token has expired.
|
||||
Try logging in again with the "balena login" command.`,
|
||||
|
||||
BalenaInvalidDeviceType: (error: Error & { deviceTypeSlug?: string }) => {
|
||||
BalenaInvalidDeviceType: (
|
||||
error: Error & { deviceTypeSlug?: string; type?: string },
|
||||
) => {
|
||||
// TODO: The SDK should be throwing a different Error for this case.
|
||||
if (
|
||||
typeof error.type === 'string' &&
|
||||
error.type.startsWith('Incompatible ')
|
||||
) {
|
||||
return error.type;
|
||||
}
|
||||
const slug = error.deviceTypeSlug ? `"${error.deviceTypeSlug}"` : 'slug';
|
||||
return stripIndent`
|
||||
Device type ${slug} not recognized. Perhaps misspelled?
|
||||
|
Loading…
x
Reference in New Issue
Block a user