blob: e0c069e65ce88f7ed9bc9099807c14cd3ba9be93 [file] [log] [blame]
Austin Schuh9049e202022-02-20 17:34:16 -08001#include "error.h"
2
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]);
18# endif
19 return (c_int)error_code;
20}
21