summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorYedaya Katsman <yedaya.ka@gmail.com>2022-12-20 21:24:42 +0200
committerAndreas Kling <kling@serenityos.org>2022-12-23 23:31:07 +0100
commitc2655d37334583d5a1b449b463011ec9dd00d8a4 (patch)
tree7b6cf5ce76351c7f3f594f4c27396868a3032773 /Userland
parent6805f71a83a85158ad80b42e27b4e1d95277ec81 (diff)
downloadserenity-c2655d37334583d5a1b449b463011ec9dd00d8a4.zip
LibSQL: Output a more specific error on failed socket creation
This can fail if /run/user/$pid/ doesn't exist, which can happen on wsl without systemd.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibSQL/SQLClient.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Libraries/LibSQL/SQLClient.cpp b/Userland/Libraries/LibSQL/SQLClient.cpp
index ae37d47498..611c6736bc 100644
--- a/Userland/Libraries/LibSQL/SQLClient.cpp
+++ b/Userland/Libraries/LibSQL/SQLClient.cpp
@@ -52,7 +52,12 @@ static ErrorOr<int> create_database_socket(DeprecatedString const& socket_path)
static ErrorOr<void> launch_server(DeprecatedString const& socket_path, DeprecatedString const& pid_path, StringView server_path)
{
- auto server_fd = TRY(create_database_socket(socket_path));
+ auto server_fd_or_error = create_database_socket(socket_path);
+ if (server_fd_or_error.is_error()) {
+ warnln("Failed to create a database socket at {}: {}", socket_path, server_fd_or_error.error());
+ return server_fd_or_error.release_error();
+ }
+ auto server_fd = server_fd_or_error.value();
auto server_pid = TRY(Core::System::fork());
if (server_pid == 0) {