Displaying message for DB constraint errors

So I noticed that when I try to create a new record in the basic app and I miss a field that is NOT NULL in the table, the app does not display any error messages - it just refreshes.

I understand that Yii2 uses jquery to validate on the fly, but say, I remove a field from the entry form, I will need to add that value in manually. However, if I forget, Yii doesn’t give any info as to what happened, so how do you add messaging for DB related errors ?

Make sure that all of your attributes are in the model rules, then it will throw an error.