FuelLabs / fuels-ts

Fuel Network Typescript SDK
https://docs.fuel.network/docs/fuels-ts/
Apache License 2.0
44.24k stars 1.34k forks source link

Improve error messaging when typegen fails #2833

Open nedsalk opened 1 month ago

nedsalk commented 1 month ago

While doing #2826 I introduced some bad logic into typegen. After running pnpm pretest on fuel-gauge to build all the typegen types, typegen threw this rather unhelpful error:

Generating types..
Type not supported: [object Object]

Something better might be:

Generating types..
Error while generating types for abi: _/path/to/abi_
Trying to generate type: _the abi type name and id_
Type not supported: [object Object]

This can also help us when users encounter such issues.

nedsalk commented 1 month ago

There was an error on my part. After I rebuilt my abi-typegen package, this error was thrown:

Type not supported: (u32, u32)

This is much more helpful, but we can still add the message of which abi is the problematic one.

petertonysmith94 commented 1 month ago

@nedsalk is this still relevant now that #2826 is closed?

nedsalk commented 1 month ago

@petertonysmith94 It is, it's just very low priority.