# Issue with action\_seterr\_extended

**URL:** <https://dmap-community.ductus.global/t/issue-with-action-seterr-extended/3859>\
**Category:** CDB and CDB API\
**Created:** [October 26, 2021, 6:46pm UTC](https://dmap-community.ductus.global/t/issue-with-action-seterr-extended/3859 "2021-10-26T18:46:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishnu891](https://avatars.discourse-cdn.com/v4/letter/v/a3d4f5/32.png) [@vishnu891](https://dmap-community.ductus.global/u/vishnu891)\
**Post date:** [October 26, 2021, 6:46pm UTC](https://dmap-community.ductus.global/t/issue-with-action-seterr-extended/3859/1 "2021-10-26T18:46:13Z")

</div>

I used dp.action\_seterr\_extended(uninfo=self.uinfo,code=CONFD\_ERRCODE\_ACCESS\_DENIED,apptag\_ns=0,apptag\_tag=0,errstr=err) instead of dp.action\_seterr(self.uinfo, err). Internally action\_seterr calls action\_seterr\_extended method but trying to change the status code.

Need 403 rest API error instead of 400 error

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [October 27, 2021, 8:14pm UTC](https://dmap-community.ductus.global/t/issue-with-action-seterr-extended/3859/2 "2021-10-27T20:14:18Z")

</div>

Try something like:

```python
    def cb_action(self, uinfo, name, keypath, params):
        dp.action_seterr_extended(uinfo, _confd.ERRCODE_ACCESS_DENIED, 0, 0, "")
        return _confd.CONFD_ERR

```

Example:

```json
POST http://localhost:8008/restconf/operations/config:config/system/reboot
status code: 403
{
  "ietf-restconf:errors": {
    "error": [
      {
        "error-type": "application",
        "error-tag": "access-denied",
        "error-path": "/config:config/system/reboot",
        "error-message": "access denied"
      }
    ]
  }
}

```
