Using evaluate with a callback function is the standard way to handle potential server-side errors in the Earth Engine JS API, e.g. parsing a date: ee.Date("2012").evaluate(function(result, err) { err ? print(err) : print(result); }); But what if we want to use promises instead? Let’s write a get_promise function that wraps any evaluatable object in a promise: /** * Return a promise that resolves when an object is evaluated. */ function get_promise(object) { return new Promise(function(reso...