PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.14.0
GiveWP – Donation Plugin and Fundraising Platform v4.14.0
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / DonationForms / resources / app / errors / FormRequestError.ts
FormRequestError.ts
25 lines 711 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * This Error adds a property of errors,
3 * so we can catch a types error and loop through all the errors from the server.
4 *
5 * @since 3.0.0
6 */
7 class FormRequestError extends Error {
8 public errors: Array<object>;
9
10 constructor(errors: Array<object>, ...params) {
11 // Pass remaining arguments (including vendor specific ones) to parent constructor
12 super(...params);
13
14 // Maintains proper stack trace for where our error was thrown (only available on V8)
15 if (Error.captureStackTrace) {
16 Error.captureStackTrace(this, FormRequestError);
17 }
18
19 this.name = 'FormRequestError';
20 this.errors = errors;
21 }
22 }
23
24 export default FormRequestError;
25