fix: improved GoosehintsModal error handling (#2932)
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
"license": {
|
||||
"name": "Apache-2.0"
|
||||
},
|
||||
"version": "1.0.27"
|
||||
"version": "1.0.28"
|
||||
},
|
||||
"paths": {
|
||||
"/agent/tools": {
|
||||
|
||||
@@ -106,9 +106,12 @@ export const GoosehintsModal = ({ directory, setIsGoosehintsModalOpen }: Goosehi
|
||||
const { file, error, found } = await getGoosehintsFile(goosehintsFilePath);
|
||||
setGoosehintsFile(file);
|
||||
setGoosehintsFileFound(found);
|
||||
setGoosehintsFileReadError(error || '');
|
||||
// Only set error if file was found but there was an actual read error
|
||||
// If file is not found, treat it as creating a new file (no error)
|
||||
setGoosehintsFileReadError(found && error ? error : '');
|
||||
} catch (error) {
|
||||
console.error('Error fetching .goosehints file:', error);
|
||||
setGoosehintsFileReadError('Failed to access .goosehints file');
|
||||
}
|
||||
};
|
||||
if (directory) fetchGoosehintsFile();
|
||||
|
||||
Reference in New Issue
Block a user