Optimise db query. Add more error detail.
This commit is contained in:
@@ -751,7 +751,8 @@ const APP = () => {
|
||||
renderLineOnMap(response.data.data);
|
||||
} catch (error) {
|
||||
console.error('Error fetching line of sight:', error);
|
||||
setApiError('Failed to fetch route. Please try again.');
|
||||
const msg = error.response?.data?.error || error.message || 'Failed to fetch route.';
|
||||
setApiError(`Error: ${msg}`);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
// Reset flight progress for a new line calculation
|
||||
|
||||
@@ -4,7 +4,7 @@ const API_BASE_URL = import.meta.env.VITE_API_URL || '/api';
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: API_BASE_URL,
|
||||
timeout: 10000,
|
||||
timeout: 30000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user