Repo for the search and displace core module including the interface to select files and search and displace operations to run on them. https://searchanddisplace.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
407 B

  1. export function isServerError(e: any) {
  2. return e &&
  3. typeof (e) === 'object' &&
  4. e.hasOwnProperty('response') &&
  5. e.response &&
  6. e.response.hasOwnProperty('data') &&
  7. e.response.data;
  8. }
  9. export function getServerErrorMessage(e: any) {
  10. const error = e.response.data;
  11. if (error.hasOwnProperty('message')) {
  12. return error.message;
  13. }
  14. return '';
  15. }