fix: misskey detection could fail due to an early axios throw #1614
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi h3poteto,
Thank you for maintaining such a wonderful library. I'm building a tool based on megalodon.
Meanwhile I found that detection on
misskey.io
failed with the5.4.0
version. Without the try catch block, Axios would throw on attempting to visithttps://misskey.io/api/v1/instance
in the first place. So I added thetry catch
back with a little more explicitness.Changes (all tests passed):
detector
handles sns name detection more thoroughlydetector
explicitly returnsnull
if no known platform can be detectedPlease let me know how you think and if there's anything that I missed or have done incorrectly. Thanks!