fermyon / spin-dotnet-sdk

Apache License 2.0
43 stars 11 forks source link

Unhandled exceptions sometimes cause `indirect call type mismatch` #26

Open itowlson opened 2 years ago

itowlson commented 2 years ago

For example, if I don't define the pg_conn_str variable in the Postgres sample, I get wasm trap: indirect call type mismatch.

But some other exceptions do get handled by the "CLR method returned an exception, send a 500 response" check. And I haven't yet figured out what the difference is.

jpflueger commented 2 years ago

I ran into this issue today. For me, it happens during the call to PostgresOutbound.Query. I've tested the query with psql and it seems to work fine. I based my code off of the example with the pg_conn_str variable, then made the connection string hard-coded and I'm still hitting the wasm trap. Happy to help investigate this as I can't seem to get past the error.

itowlson commented 2 years ago

Are you able to share your code? (even if only in a private repo)

itowlson commented 2 years ago

Is Wizer on or off? Wizer can introduce errors of this nature - if it's on, try turning it off and rebuilding, and see if that helps.

jpflueger commented 2 years ago

That did the trick for me, thanks!

I can supply some sample code but it is pretty similar to existing samples that I've been working off of.