File tree Expand file tree Collapse file tree
packages/core/src/session_pool Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -346,13 +346,8 @@ export class Session implements ISession {
346346 * @param url website url. Only cookies stored for this url will be returned
347347 */
348348 getCookies ( url : string ) : CookieObject [ ] {
349- try {
350- const cookies = this . cookieJar . getCookiesSync ( url ) ;
351- return cookies . map ( ( c ) => toughCookieToBrowserPoolCookie ( c ) ) ;
352- } catch ( e ) {
353- this . log . warning ( 'Could not get cookies from cookie jar.' , { url, error : ( e as Error ) . message } ) ;
354- return [ ] ;
355- }
349+ const cookies = this . cookieJar . getCookiesSync ( url ) ;
350+ return cookies . map ( ( c ) => toughCookieToBrowserPoolCookie ( c ) ) ;
356351 }
357352
358353 /**
@@ -362,12 +357,7 @@ export class Session implements ISession {
362357 * @returns Represents `Cookie` header.
363358 */
364359 getCookieString ( url : string ) : string {
365- try {
366- return this . cookieJar . getCookieStringSync ( url , { } ) ;
367- } catch ( e ) {
368- this . log . warning ( 'Could not get cookie string.' , { url, error : ( e as Error ) . message } ) ;
369- return '' ;
370- }
360+ return this . cookieJar . getCookieStringSync ( url , { } ) ;
371361 }
372362
373363 /**
You can’t perform that action at this time.
0 commit comments