factor out promise rejection object type which must always be Error