R/008_utilities_error.R

Defines functions SolverError DCPError

Documented in DCPError SolverError

#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/utilities/error.R
#####

## CVXPY SOURCE: error.py
## Custom error/condition constructors for CVXR

#' DCP Error condition
#'
#' Creates a custom R condition of class "DCPError" for disciplined
#' convex programming violations.
#'
#' @param message Character error message
#' @param call The call to include in the condition (default: caller's call)
#' @returns A condition object of class c("DCPError", "error", "condition")
#' @keywords internal
DCPError <- function(message, call = sys.call(-1L)) {
  structure(
    class = c("DCPError", "error", "condition"),
    list(message = message, call = call)
  )
}

#' Solver Error condition
#'
#' Creates a custom R condition of class "SolverError" for solver failures.
#'
#' @param message Character error message
#' @param call The call to include in the condition (default: caller's call)
#' @returns A condition object of class c("SolverError", "error", "condition")
#' @keywords internal
SolverError <- function(message, call = sys.call(-1L)) {
  structure(
    class = c("SolverError", "error", "condition"),
    list(message = message, call = call)
  )
}

Try the CVXR package in your browser

Any scripts or data that you put into this service are public.

CVXR documentation built on March 6, 2026, 9:10 a.m.