Make metadata.deploy fail instead of never resolving on incorrect input

It took me a long time to figure out what I was doing wrong, since there was no error given to me, it just seemed like the deployment never finished, because the promise was never resolved or rejected.