> For the complete documentation index, see [llms.txt](https://ksdaemon.gitbook.io/wampy.js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ksdaemon.gitbook.io/wampy.js/api/getopstatus.md).

# getOpStatus()

### getOpStatus()

Returns the status of last operation. This method returns an object with attributes:

* `code` is integer, and value > 0 means error.
* `error` is Error instance of last operation. Check errors types exposed by wampy.
* `reqId` is a Request ID of last successful operation. It is useful in some cases (call canceling for example).

```javascript
let defer = ws.publish('system.monitor.update');
console.log(ws.getOpStatus());
// may return
//    { code: 1, error: UriError instance }
// or { code: 2, error: NoBrokerError instance }
// or { code: 0, error: null }
```
