orbs-network/orbs-client-sdk-javascript

better error message on unsupported return type

amir-arad opened this issue · 1 comments

When accidentally returning a boolean from the contract, I get the error:

     Error: received argument 0 has unknown type: 65535
      at Ce (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:8:29510)
      at et (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:8:38018)
      at e.<anonymous> (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:8:47002)
      at c (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:1:171510)
      at Generator._invoke (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:1:171298)
      at Generator.e.<computed> [as next] (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:1:171932)
      at r (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:1:24553)
      at o (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:1:24763)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)

a better error message could state the supported types, and/or direct to the data types documentation.

out of scope questions that arise:

  • why is uint16 used for the type enum (why not uint8)?
  • why not support smallest return types (byte)?