RPC return Error in type script

How do I return errors for RPC calls so that the errorCallback function gets executed on the client side?

  1. Versions: Nakama 3.4, Windows, Docker, UE4.25 2.4.0 plugin version
  2. Server Framework Runtime language: TS/JS

I’m not sure how the errorCallback is triggered client side, but to return an error server side you’d return this object with one of the codes defined above it, which translate to http status codes as documented here.