@percy/client
Advanced tools
Comparing version 1.28.8 to 1.28.9-beta.0
@@ -6,3 +6,3 @@ import fs from 'fs'; | ||
import Pako from 'pako'; | ||
import { pool, request, formatBytes, sha256hash, base64encode, getPackageJSON, waitForTimeout, validateTiles, tagsList } from './utils.js'; | ||
import { pool, request, formatBytes, sha256hash, base64encode, getPackageJSON, waitForTimeout, validateTiles, formatLogErrors, tagsList } from './utils.js'; | ||
@@ -547,4 +547,8 @@ // Default client API URL can be set with an env var for API development | ||
if (!success) { | ||
this.log.error('Uploading comparison tile failed'); | ||
return false; | ||
let errMsg = 'Uploading comparison tile failed'; | ||
// Detecting error and logging fix for the same | ||
// We are throwing this error as the comparison will be failed | ||
// even if 1 tile gets failed | ||
throw new Error(errMsg); | ||
} | ||
@@ -614,2 +618,9 @@ return true; | ||
} | ||
async getErrorAnalysis(errors) { | ||
const errorLogs = formatLogErrors(errors); | ||
this.log.debug('Sending error logs for analysis'); | ||
return this.post('suggestions/from_logs', { | ||
data: errorLogs | ||
}); | ||
} | ||
mayBeLogUploadSize(contentSize) { | ||
@@ -616,0 +627,0 @@ if (contentSize >= 25 * 1024 * 1024) { |
@@ -158,4 +158,12 @@ import net from 'net'; | ||
let handleError = err => { | ||
var _err$message, _err$message2; | ||
socket.destroy(err); | ||
logger('client:proxy').error(`Proxying request failed: ${err}`); | ||
// We don't get statusCode here, relying on checking error message only | ||
if (!!err.message && ((_err$message = err.message) !== null && _err$message !== void 0 && _err$message.includes('ECONNREFUSED') || (_err$message2 = err.message) !== null && _err$message2 !== void 0 && _err$message2.includes('EHOSTUNREACH'))) { | ||
logger('client:proxy').warn('If needed, Please verify if your proxy credentials are correct'); | ||
logger('client:proxy').warn('Please check if your proxy is set correctly and reachable'); | ||
} | ||
logger('client:proxy').warn('Please check network connection, proxy and ensure that following domains are whitelisted: github.com, percy.io, storage.googleapis.com. In case you are an enterprise customer make sure to whitelist "percy-enterprise.browserstack.com" as well.'); | ||
callback(err); | ||
@@ -162,0 +170,0 @@ }; |
@@ -236,2 +236,22 @@ import os from 'os'; | ||
} | ||
export function formatLogErrors(errorLogs) { | ||
let errors = []; | ||
if (typeof errorLogs === 'string') { | ||
errors.push({ | ||
message: errorLogs | ||
}); | ||
} else if (Array.isArray(errorLogs)) { | ||
errors = errorLogs; | ||
} else { | ||
errors.push({ | ||
message: errorLogs | ||
}); | ||
errors.push({ | ||
message: (errorLogs === null || errorLogs === void 0 ? void 0 : errorLogs.message) || '' | ||
}); | ||
} | ||
return { | ||
logs: errors | ||
}; | ||
} | ||
@@ -250,2 +270,2 @@ // convert tags comma-separated-names to array of objects for POST request | ||
} | ||
export { hostnameMatches, ProxyHttpAgent, ProxyHttpsAgent, proxyAgentFor } from './proxy.js'; | ||
export { hostnameMatches, getProxy, ProxyHttpAgent, ProxyHttpsAgent, proxyAgentFor } from './proxy.js'; |
{ | ||
"name": "@percy/client", | ||
"version": "1.28.8", | ||
"version": "1.28.9-beta.0", | ||
"license": "MIT", | ||
@@ -12,3 +12,3 @@ "repository": { | ||
"access": "public", | ||
"tag": "latest" | ||
"tag": "beta" | ||
}, | ||
@@ -36,7 +36,7 @@ "engines": { | ||
"dependencies": { | ||
"@percy/env": "1.28.8", | ||
"@percy/logger": "1.28.8", | ||
"@percy/env": "1.28.9-beta.0", | ||
"@percy/logger": "1.28.9-beta.0", | ||
"pako": "^2.1.0" | ||
}, | ||
"gitHead": "1b93761a01b608afadf8d4efccacc11f925396bd" | ||
"gitHead": "a1114f1e18518012f48756c9558a8e7895d2b3a9" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50950
1202
2
+ Added@percy/env@1.28.9-beta.0(transitive)
+ Added@percy/logger@1.28.9-beta.0(transitive)
- Removed@percy/env@1.28.8(transitive)
- Removed@percy/logger@1.28.8(transitive)
Updated@percy/env@1.28.9-beta.0
Updated@percy/logger@1.28.9-beta.0