( action: () => Return | Promise<Return>, then1?: (error: any) => void, then2?: (error: any) => void, )
| 159 | }; |
| 160 | |
| 161 | export const tryCatch = async <Return>( |
| 162 | action: () => Return | Promise<Return>, |
| 163 | then1?: (error: any) => void, |
| 164 | then2?: (error: any) => void, |
| 165 | ): Promise<Return | void> => { |
| 166 | try { |
| 167 | return await action(); |
| 168 | } catch (error) { |
| 169 | /*! istanbul ignore next */ |
| 170 | then1?.(error); |
| 171 | then2?.(error); |
| 172 | } |
| 173 | }; |
no outgoing calls
no test coverage detected
searching dependent graphs…