diff --git a/when/when.d.ts b/when/when.d.ts index 3b7d114f7..ca2400fc5 100644 --- a/when/when.d.ts +++ b/when/when.d.ts @@ -56,6 +56,11 @@ declare module When { } interface Promise { + // Make sure you test any usage of these overloads, exceptionType must + // be a constructor with prototype set to an instance of Error. + catch(exceptionType: any, onRejected?: (reason: any) => Promise): Promise; + catch(exceptionType: any, onRejected?: (reason: any) => U): Promise; + catch(filter: (reason: any) => Boolean, onRejected?: (reason: any) => Promise): Promise; catch(filter: (reason: any) => Boolean, onRejected?: (reason: any) => U): Promise;