Update error message to include specific reason for failure in Export.jsx

This commit is contained in:
Sergey Krashevich 2023-06-14 13:28:40 +03:00
parent b3a171b2f8
commit 3e5e1bacce
No known key found for this signature in database
GPG Key ID: 625171324E7D3856

View File

@ -1,5 +1,5 @@
import Heading from '../components/Heading';
import { useState, useEffect } from 'preact/hooks';
import { useState } from 'preact/hooks';
import useSWR from 'swr';
import Button from '../components/Button';
import axios from 'axios';
@ -53,7 +53,7 @@ export default function Export() {
setMessage({ text: 'Successfully started export. View the file in the /exports folder.', error: false });
})
.catch((error) => {
setMessage({ text: 'Failed to start export.', error: true });
setMessage({ text: 'Failed to start export: '+error.response.data.message, error: true });
});
};