Skip to content

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
driverag22 committed Feb 7, 2023
1 parent da02e3f commit 8fde985
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/coq/serapi/processors/SerapiSearchProcessor.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import SerapiProcessor from '../util/SerapiProcessor';
import {Mutex} from 'async-mutex';
import {
createCheckCommand, createIndexedQueryVernacCommand,
createSearchCommand,
createCheckCommand, createQueryVernacCommand,
createIndexedQueryVernacCommand, createSearchCommand,
} from '../util/SerapiCommandFactory';
import {COQ_EXCEPTION, parseErrorResponse} from '../SerapiParser';

Expand Down Expand Up @@ -218,10 +218,9 @@ class SerapiSearchProcessor extends SerapiProcessor {
*/
async _queryCommand(command) {
try {
const sentenceId = this.state.idOfSentence(this.state.lastExecuted);
return this.sendCommand(
createIndexedQueryVernacCommand(
command, sentenceId), 'raw',
command, this.state.idOfSentence(this.state.lastExecuted)), 'raw',
(feedback) => {
return {
result: feedback.string,
Expand All @@ -236,10 +235,9 @@ class SerapiSearchProcessor extends SerapiProcessor {
}
});
} catch (e) {
const sentenceId = 1;
return this.sendCommand(
createIndexedQueryVernacCommand(
command, sentenceId), 'raw',
createQueryVernacCommand(
command), 'raw',
(feedback) => {
return {
result: feedback.string,
Expand Down

0 comments on commit 8fde985

Please sign in to comment.