Throwing a C++ exception creates unnecessary overhead, so when an unsupported operation is encountered, the api error is directly returned instead of being thrown.