fixed unknown file error

fix_askerrorhandling
STetsing 1 week ago
parent 2b9a1e3fe2
commit 4e119512d4
  1. 9
      libs/remix-ui/renderer/src/lib/renderer.tsx

@ -88,7 +88,12 @@ export const Renderer = ({ message, opt, plugin, context }: RendererProps) => {
const askGtp = async () => {
try {
const content = await plugin.call('fileManager', 'readFile', editorOptions.errFile)
let content;
try {
content = await plugin.call('fileManager', 'readFile', editorOptions.errFile)
} catch (error) {
content = await plugin.call('fileManager', 'readFile', await plugin.call('config', 'getAppParameter', 'currentFile'));
}
const message = intl.formatMessage({ id: `${context || 'solidity' }.openaigptMessage` }, { content, messageText })
await plugin.call('popupPanel', 'showPopupPanel', true)
@ -97,7 +102,7 @@ export const Renderer = ({ message, opt, plugin, context }: RendererProps) => {
}, 500)
_paq.push(['trackEvent', 'ai', 'remixAI', 'error_explaining_SolidityError'])
} catch (err) {
console.error('unable to askGtp')
console.error('unable to ask RemixAI')
console.error(err)
}
}

Loading…
Cancel
Save