group-domains: fix uncaught TypeError due to invalid URLs#3383
Merged
PromoFaux merged 1 commit intopi-hole:developmentfrom Apr 5, 2025
XhmikosR:xmr/url
Merged
group-domains: fix uncaught TypeError due to invalid URLs#3383PromoFaux merged 1 commit intopi-hole:developmentfrom XhmikosR:xmr/url
PromoFaux merged 1 commit intopi-hole:developmentfrom
XhmikosR:xmr/url
Conversation
Member
|
"fix uncaught TypeError " By chucking it inside an empty try/catch - is this not just supressing it, rather than fixing? |
Contributor
Author
|
But we need it to be suppressed in this case because we need a valid URL.
The input has type URL set, which is probably wrong but that's for another
time.
Give the patch a go after you try on dev branch with the browser console
open and you'll see what I mean :)
…On Fri, Apr 4, 2025, 20:49 Adam Warner ***@***.***> wrote:
"fix uncaught TypeError "
By chucking it inside an empty try/catch - is this not just *supressing*
it, rather than fixing?
—
Reply to this email directly, view it on GitHub
<#3383 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACVLNLY6VROJGYIKLJJADT2X3A3FAVCNFSM6AAAAAB2NZITJ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZZGQYDMNZWGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
[image: PromoFaux]*PromoFaux* left a comment (pi-hole/web#3383)
<#3383 (comment)>
"fix uncaught TypeError "
By chucking it inside an empty try/catch - is this not just *supressing*
it, rather than fixing?
—
Reply to this email directly, view it on GitHub
<#3383 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACVLNLY6VROJGYIKLJJADT2X3A3FAVCNFSM6AAAAAB2NZITJ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZZGQYDMNZWGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Member
|
Right, OK - so supressing this particular error is the correct course of action here, because the error thrown is irrelevant. What if an error is thrown by one of the other lines within the try/catch block? As it stands, we will lose visibility of that error. |
Contributor
Author
|
OK I will change the function to ignore only these specific errors later
…On Fri, Apr 4, 2025, 21:07 Adam Warner ***@***.***> wrote:
Right, OK - so supressing this particular error is the correct course of
action here, because the error thrown is irrelevant.
What if an error is thrown by one of the other lines within the try/catch
block? As it stands, we will lose visibility of that error.
—
Reply to this email directly, view it on GitHub
<#3383 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACVLNKTJWNLNFFOY66JTXT2X3C6HAVCNFSM6AAAAAB2NZITJ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZZGQZTSMZSHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
[image: PromoFaux]*PromoFaux* left a comment (pi-hole/web#3383)
<#3383 (comment)>
Right, OK - so supressing this particular error is the correct course of
action here, because the error thrown is irrelevant.
What if an error is thrown by one of the other lines within the try/catch
block? As it stands, we will lose visibility of that error.
—
Reply to this email directly, view it on GitHub
<#3383 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACVLNKTJWNLNFFOY66JTXT2X3C6HAVCNFSM6AAAAAB2NZITJ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZZGQZTSMZSHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Member
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
Contributor
Author
|
Chrome throws a different error. Try the latest patch please. |
PromoFaux
approved these changes
Apr 5, 2025
Member
PromoFaux
left a comment
There was a problem hiding this comment.
Cool, working as expected now
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

The error happens because the
URLconstructor throws an error if the url is not valid.Non-whitespace diff: https://github.com/pi-hole/web/pull/3383/files?w=1
Thank you for your contribution to the Pi-hole Community!
Please read the comments below to help us consider your Pull Request.
We are all volunteers and completing the process outlined will help us review your commits quicker.
Please make sure you
What does this PR aim to accomplish?:
How does this PR accomplish the above?:
Link documentation PRs if any are needed to support this PR:
By submitting this pull request, I confirm the following:
git rebase)