fix(chromium): increase the scope of loading failed errors (#962)

This commit is contained in:
Julien Neuhart
2024-09-07 15:54:01 +02:00
committed by GitHub
parent 300e73f07d
commit a3647fea8a
6 changed files with 60 additions and 31 deletions

View File

@@ -1436,10 +1436,10 @@ func TestConvertUrl(t *testing.T) {
expectOutputPathsCount: 0,
},
{
scenario: "ErrConnectionRefused",
scenario: "ErrLoadingFailed",
ctx: &api.ContextMock{Context: new(api.Context)},
api: &ApiMock{PdfMock: func(ctx context.Context, logger *zap.Logger, url, outputPath string, options PdfOptions) error {
return ErrConnectionRefused
return ErrLoadingFailed
}},
options: DefaultPdfOptions(),
expectError: true,
@@ -1646,10 +1646,10 @@ func TestScreenshotUrl(t *testing.T) {
expectOutputPathsCount: 0,
},
{
scenario: "ErrConnectionRefused",
scenario: "ErrLoadingFailed",
ctx: &api.ContextMock{Context: new(api.Context)},
api: &ApiMock{ScreenshotMock: func(ctx context.Context, logger *zap.Logger, url, outputPath string, options ScreenshotOptions) error {
return ErrConnectionRefused
return ErrLoadingFailed
}},
options: DefaultScreenshotOptions(),
expectError: true,