Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give an error message when there is an invalid ID #177

Open
hf02 opened this issue Feb 1, 2023 · 4 comments
Open

Give an error message when there is an invalid ID #177

hf02 opened this issue Feb 1, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@hf02
Copy link

hf02 commented Feb 1, 2023

Is your feature request related to a problem? Please describe.
Somewhere in my notes I have an invalid ID. I have no idea which one, and the console gave a cryptic error, so I assumed it was a bug and made #176.

Describe the solution you'd like
An error message saying which ID is invalid, so I can CTRL + F it and remove it.

Describe alternatives you've considered
Going one by one to find the invalid ID, or nuking the note and having it regenerate everything.

@hf02 hf02 added the enhancement New feature or request label Feb 1, 2023
@hf02 hf02 changed the title Give an error message when there is an invalid ID. Give an error message when there is an invalid ID Feb 1, 2023
@harmtemolder
Copy link

I'm digging into why this is happening to me too, and it seems that I've deleted a note from Anki. Therefore the plugin cannot find the note matching one of the IDs from my file in Obsidian.

I'm not sure what the expected behavior would be in this case. Maybe also delete the note from Obsidian?

@harmtemolder
Copy link

There actually is something here that should output a nice error message when a card is not present in Anki:

      if (cardsNotInAnki) {
        console.info("Flashcards: Cards not in Anki (maybe deleted)");
        for (const card of cardsNotInAnki) {
          this.notifications.push(
            `Error: Card with ID ${card.id} is not in Anki!`
          );
        }
      }

But apparently that doesn't work

@harmtemolder
Copy link

The __init__() missing 3 required positional arguments: 'help_page', 'context', and 'backtrace' error actually comes from Anki via reject(e) in anki.ts. So this might be something we'd need to pick up with the developer of the AnkiConnect Anki plugin...

@harmtemolder
Copy link

harmtemolder commented Feb 17, 2023

Or maybe we could do findNotes and compare the received list with what we have in Obsidian, and then only run notesInfo for the existing notes

Edit: That was easier than expected, see PR #182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants