Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Option for writeMedia to log warnings and continue instead of returning at the first error #63

Open
gbogarinb opened this issue Jul 30, 2023 · 2 comments

Comments

@gbogarinb
Copy link

Coming from lapwat/papeer#12
Is it possible to just log a warning instead of returning an error?
In my particular case, there seems to be a broken img link that is halting the whole process, I really don't care if a single image is not downloaded so I would still like for the process to continue.

@bmaupin
Copy link
Owner

bmaupin commented Jul 31, 2023

Yes, this library needs to handle errors better. We have an open issue to improve error handling (#49) but that's for returning an error instead of using panic.

This seems like a feature request to disable the validation altogether so an error isn't thrown. I like the idea to have that as an option.

@Monirzadeh
Copy link
Contributor

Monirzadeh commented Aug 19, 2023

possible to just log a warning instead of returning an error?

@gbogarinb can you please give a code example that get you in trouble?
as i see if you use addMedia(or similar method) it can return error if it field and you can handle that yourself to log that. as i see you don't use writeMedia directly.
please review #67

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

Successfully merging a pull request may close this issue.

3 participants