From b4de4226784d5f9ae48d5c78515f8499d11a507c Mon Sep 17 00:00:00 2001 From: Wim Looman Date: Thu, 4 Dec 2014 08:40:44 +1300 Subject: [PATCH] Add exception type filter using any --- when/when.d.ts | 5 +++++ 1 file changed, 5 insertions(+) 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;