Skip to content

File error.h

File List > docs > sandwich_c > error.h

Go to the documentation of this file

// Copyright (c) SandboxAQ. All rights reserved.
// SPDX-License-Identifier: AGPL-3.0-only


#pragma once

#include "sandwich_c/error_codes.h"
#include "sandwich_c/export.h"

#ifdef __cplusplus
extern "C" {
#endif

struct SandwichError {
  struct SandwichError *details;

  const char *msg;

  SandwichErrorKind kind;

  int code;
};

SANDWICH_API void sandwich_error_free(struct SandwichError *chain);

SANDWICH_API char *
sandwich_error_stack_str_new(const struct SandwichError *chain);

SANDWICH_API void sandwich_error_stack_str_free(const char *err_str);

#ifdef __cplusplus
} // end extern "C"
#endif