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

Please return the error from create_new_note_from_template #1512

Open
danielo515 opened this issue Dec 17, 2024 · 0 comments
Open

Please return the error from create_new_note_from_template #1512

danielo515 opened this issue Dec 17, 2024 · 0 comments

Comments

@danielo515
Copy link

Hello, and as always, thanks for this great plugin.

I'm the author of modal-forms, an obsidian plugin that is heavily dependent on templater.
I am adding a new feature that allows to create a new note from a form and I want it to also support templater templates.
I am using the following method:

if (output_content == null) {
await this.plugin.app.vault.delete(created_note);
await this.end_templater_task(path);
return;
}

However, from the outside it is not possible to know why the method failed, as when failing you just return undefined. This makes hard to provide a good user experience.
Can you consider returning the error message? So I can properly handle it and show it in the UI?

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

No branches or pull requests

1 participant