remove unnecessary try/catch
This commit is contained in:
1 parent
da89789a97
commit
0aaeeef113
1 file changed
-4
@@ -13,7 +13,6 @@ const handleError = (error, serviceName, method, status = 500) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const fetchMonitorCertificate = async (sslChecker, monitor) => {
|
const fetchMonitorCertificate = async (sslChecker, monitor) => {
|
||||||
try {
|
|
||||||
const monitorUrl = new URL(monitor.url);
|
const monitorUrl = new URL(monitor.url);
|
||||||
const hostname = monitorUrl.hostname;
|
const hostname = monitorUrl.hostname;
|
||||||
const cert = await sslChecker(hostname);
|
const cert = await sslChecker(hostname);
|
||||||
@@ -22,9 +21,6 @@ const fetchMonitorCertificate = async (sslChecker, monitor) => {
|
|||||||
throw new Error("Certificate not found");
|
throw new Error("Certificate not found");
|
||||||
}
|
}
|
||||||
return cert;
|
return cert;
|
||||||
} catch (error) {
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export { handleValidationError, handleError, fetchMonitorCertificate };
|
export { handleValidationError, handleError, fetchMonitorCertificate };
|
||||||
Reference in new issue
Block a user