blob: 767bb1741454fb644003e413d7916eaa07b67116 [file] [log] [blame]
Austin Schuhd9e9dea2022-02-20 19:54:42 -08001#include "osqp_error.h"
Austin Schuh9049e202022-02-20 17:34:16 -08002
3const char *OSQP_ERROR_MESSAGE[] = {
4 "Problem data validation.",
5 "Solver settings validation.",
6 "Linear system solver not available.\nTried to obtain it from shared library.",
7 "Linear system solver initialization.",
8 "KKT matrix factorization.\nThe problem seems to be non-convex.",
9 "Memory allocation.",
10 "Solver workspace not initialized.",
11};
12
13
14c_int _osqp_error(enum osqp_error_type error_code,
15 const char * function_name) {
16# ifdef PRINTING
17 c_print("ERROR in %s: %s\n", function_name, OSQP_ERROR_MESSAGE[error_code-1]);
Austin Schuhd9e9dea2022-02-20 19:54:42 -080018# else
19 (void)function_name;
Austin Schuh9049e202022-02-20 17:34:16 -080020# endif
21 return (c_int)error_code;
22}
23