Is there error raised from api when creating deployment without enough resources?

I used python k8s client to create a deployment. When space is insufficient the create api will just hold there and waiting for more resources. Need to check from k8s GUI to root the issue. Is it possible to raise error when resources not enough?