Question: Why deleting non-existing record does not raise an error in sqlalchemy.
no feedback on whether the record was deleted or not.

```
session.query(Element).filter(Element.id==ElementId).delete()

```

Thank you for your clarification.

Answer: 
Actually, sqlalchemy delete operation returns number of affected rows. So you can check and if affected rows is 0 then you can raise error.

```
effected_rows = session.query(Element).filter(Element.id==ElementId).delete()
if effected_rows == 0:
    # raise exception
else:
    # delete element

```

This works for me.
Adding an answer to @madogan, the edit queue was full and hence writing a new answer.

I've expanded his answer more in detail in a working solution:

```
class NoEntryFoundException(Exception):
    pass

def delete_row_entry(element_id: int):
    effected_rows = session.query(Element).filter(Element.id == element_id).delete()

    if effected_rows == 0:
        raise NoEntryFoundException(f'No row entry found with id: {element_id}')
    else:
        session.commit()

```