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

[2.x] Revert to throwing an exception when trying to get non-configured base URL #1890

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Jul 23, 2024

Reverts the unreleased behaviour where this returns null. Returning null for a fault path means the developer needs to check for null types, but that solves the problem. If the developer cares about site URLs they need to set the site URL, and having a null that can silently be ignored is unintuitive. If the user tries to get a base URL and one is not set, that's a bug, and throwing an exception alerts them of it. It is not justified to have the custom exception for this, so that is still removed, and we now throw a BadMethodCallException instead. This essentially reverts most of #1760. See tie in with e9778a9

@caendesilva caendesilva force-pushed the revert-to-throwing-when-trying-to-get-unconfigured-base-url branch from aa15d79 to 790654c Compare July 23, 2024 18:38
caendesilva added a commit that referenced this pull request Jul 23, 2024
Updates for the new changes in #1890
caendesilva pushed a commit to hydephp/framework that referenced this pull request Jul 23, 2024
@caendesilva caendesilva marked this pull request as ready for review July 23, 2024 18:40
@caendesilva caendesilva merged commit cad93d5 into 2.x-dev Jul 23, 2024
7 checks passed
@caendesilva caendesilva deleted the revert-to-throwing-when-trying-to-get-unconfigured-base-url branch July 23, 2024 18:40
caendesilva pushed a commit to hydephp/framework that referenced this pull request Jul 23, 2024
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

Successfully merging this pull request may close these issues.

1 participant