1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "LaunchError.h"
10 # include "mozilla/WinHeaderOnlyUtils.h"
13 namespace mozilla::ipc
{
15 LaunchError::LaunchError(const char* aFunction
, OsError aError
)
16 : mFunction(aFunction
), mError(aError
) {}
19 LaunchError::LaunchError(const char* aFunction
, PRErrorCode aError
)
20 : mFunction(aFunction
), mError((int)aError
) {}
22 LaunchError::LaunchError(const char* aFunction
, DWORD aError
)
23 : mFunction(aFunction
),
24 mError(WindowsError::FromWin32Error(aError
).AsHResult()) {}
25 #endif // defined(XP_WIN)
27 const char* LaunchError::FunctionName() const { return mFunction
; }
29 OsError
LaunchError::ErrorCode() const { return mError
; }
31 } // namespace mozilla::ipc