Skip to content

Commit c3a3f8e

Browse files
update error text
1 parent 60896e9 commit c3a3f8e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/structs/2captcha.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ export class Solver {
825825
*
826826
* [Read more about "Amazon WAF" captcha](https://2captcha.com/2captcha-api#amazon-waf).
827827
*
828-
* @param {{ pageurl, sitekey, iv, context, pingback, proxy, proxytype}} params The `amazonWaf` method takes arguments as an object. Thus, the `pageurl`, `sitekey`, `iv`, `context` fields in the passed object are mandatory. [Open example](https://github.com/dzmitry-duboyski/2captcha-ts/blob/master/tests/amazonWaf.js)
828+
* @param {{ pageurl, sitekey, iv, context, pingback, proxy, proxytype}} params The `amazonWaf` method takes arguments as an object. Thus, the `pageurl`, `sitekey`, `iv`, `context` fields in the passed object are mandatory.
829829
* @param {string} params.pageurl Is the full `URL` of page where you were challenged by the captcha.
830830
* @param {string} params.sitekey Is a value of `key` parameter in the page source.
831831
* @param {string} params.iv Is a value of `iv` parameter in the page source.
@@ -879,7 +879,7 @@ export class Solver {
879879
*
880880
* [Read more about Cloudflare Turnstile captcha](https://2captcha.com/2captcha-api#turnstile).
881881
*
882-
* @param {{ pageurl, sitekey, action, data, pingback, proxy, proxytype}} params The `сloudflareTurnstile` method takes arguments as an object. Thus, the `pageurl`, `sitekey` fields in the passed object are mandatory. [Open example](https://github.com/dzmitry-duboyski/2captcha-ts/blob/master/tests/turnstile.js)
882+
* @param {{ pageurl, sitekey, action, data, pingback, proxy, proxytype}} params The `сloudflareTurnstile` method takes arguments as an object. Thus, the `pageurl`, `sitekey` fields in the passed object are mandatory.
883883
* @param {string} params.pageurl Full `URL` of the page where you see the captcha.
884884
* @param {string} params.sitekey Is a value of `sitekey` parameter in the page source.
885885
* @param {string} params.action Value of optional `action` parameter you found on page.

src/structs/2captchaError.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class APIError extends Error {
5858
}; break;
5959
case "ERROR_UPLOAD": {
6060
this.code = 14
61-
this.message = "The Solve Request was malformed. Please make sure the image is valid. If it is, please open up a github issue detailing this event. https://github.com/dzmitry-duboyski/2captcha-ts"
61+
this.message = "The Solve Request was malformed. Please make sure the image is valid. If it is, please open up a github issue detailing this event."
6262
}; break;
6363
case "ERROR_IP_NOT_ALLOWED": {
6464
this.code = 15
@@ -94,7 +94,7 @@ export class APIError extends Error {
9494
}; break;
9595
case "ERROR_BAD_PARAMETERS": {
9696
this.code = 23
97-
this.message = "Some parameters are missing in this request. If you're using a pre-provided function, please open up an issue on the GitHub (https://github.com/dzmitry-duboyski/2captcha-ts)"
97+
this.message = "Some parameters are missing in this request. If you're using a pre-provided function, please open up an issue on the GitHub"
9898
}; break;
9999
case "ERROR_BAD_PROXY": {
100100
this.code = 24
@@ -108,7 +108,7 @@ export class APIError extends Error {
108108
// Start for Res.php errors
109109
case "CAPCHA_NOT_READY": {
110110
this.code = 25
111-
this.message = "The captcha is not solved yet. If you see this error, Please open up an issue on the GitHub (https://github.com/dzmitry-duboyski/2captcha-ts)"
111+
this.message = "The captcha is not solved yet. If you see this error, Please open up an issue on the GitHub"
112112
}; break;
113113
case "ERROR_WRONG_ID_FORMAT": {
114114
this.code = 26
@@ -140,7 +140,7 @@ export class APIError extends Error {
140140
}; break;
141141
case "ERROR_EMPTY_ACTION": {
142142
this.code = 33
143-
this.message = "The ACtion parameter is missing. Please open an issue in the GitHub (https://github.com/dzmitry-duboyski/2captcha-ts)"
143+
this.message = "The ACtion parameter is missing. Please open an issue in the GitHub"
144144
}; break;
145145
case "ERROR_PROXY_CONNECTION_FAILED": {
146146
this.code = 34

src/utils/checkCaptchaParams.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default function checkCaptchaParams(params: Object, method: string) {
105105

106106
if(isThisFieldNotAvailable) {
107107
isCorrectCaptchaParams = false
108-
throw new Error(`Error when check params captcha.\nNot found "${fieldName}" field in the Object. Field "${fieldName}" is required for "${method}" method. Please add field "${fieldName}" in object and try again.\nPlease correct your code for the "${method}" method according to the code examples on page https://www.npmjs.com/package/2captcha-ts`)
108+
throw new Error(`Error when check params captcha.\nNot found "${fieldName}" field in the Object. Field "${fieldName}" is required for "${method}" method. Please add field "${fieldName}" in object and try again.\nPlease correct your code for the "${method}" method according to the code examples`)
109109
} else {
110110
isCorrectCaptchaParams = true
111111
}
@@ -116,7 +116,7 @@ export default function checkCaptchaParams(params: Object, method: string) {
116116
isCorrectCaptchaParams = true
117117
} else {
118118
isCorrectCaptchaParams = false
119-
throw new Error(`Error when check params captcha.\nNot found "textinstructions" or "imginstructions" field in the Object. One of this field is required for "bounding_box" method. Please add field "textinstructions" or "imginstructions" in object and try again.\nPlease correct your code for the "bounding_box" method according to the code examples on page https://www.npmjs.com/package/2captcha-ts`)
119+
throw new Error(`Error when check params captcha.\nNot found "textinstructions" or "imginstructions" field in the Object. One of this field is required for "bounding_box" method. Please add field "textinstructions" or "imginstructions" in object and try again.\nPlease correct your code for the "bounding_box" method according to the code examples`)
120120
}
121121
}
122122

0 commit comments

Comments
 (0)