Serenity Operating System
1/*
2 * Copyright (c) 2023, Liav A. <liavalb@hotmail.co.il>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#include <AK/Error.h>
8
9#ifdef KERNEL
10# include <AK/Format.h>
11#endif
12
13namespace AK {
14
15Error Error::from_string_view_or_print_error_and_return_errno(StringView string_literal, [[maybe_unused]] int code)
16{
17#ifdef KERNEL
18 dmesgln("{}", string_literal);
19 return Error::from_errno(code);
20#else
21 return Error::from_string_view(string_literal);
22#endif
23}
24
25}