PluginProbe
Extendify / 3.1.2
Extendify v3.1.2
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / QuickEdit / lib / errors.js

errors.js in Extendify 3.1.2, at src/QuickEdit/lib/errors.js

19 lines 681 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2
3 // Collapses any Quick Edit save/load error into a user-facing message. The raw
4 // err.message still flows to insights via track() — only the displayed string
5 // is generalized. An expired REST nonce gets its own copy because "try again"
6 // is wrong advice: the page has to be refreshed to mint a fresh nonce.
7 export const friendlyMessage = (err) => {
8 if (err?.body?.code === 'rest_cookie_invalid_nonce') {
9 return __(
10 'Your session expired. Please refresh the page and try again.',
11 'extendify-local',
12 );
13 }
14 return __(
15 'Sorry, something went wrong. Please try again or try editing something else.',
16 'extendify-local',
17 );
18 };
19