We might want to check err.code here to make 100% sure that the right error is triggered