You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: report_mosek_error.m
    path of file: ./repos/gptoolbox/utility
    
    the code of the file until where you have to start completion: function report_mosek_error(r,res)
  % REPORT_MOSEK_ERROR issue warning or error on return values from running
  % mosekopt
  %
  % [r,res] = report_mosek_error(r,res)
  %

    
function report_mosek_error(r,res)
  % REPORT_MOSEK_ERROR issue warning or error on return values from running
  % mosekopt
  %
  % [r,res] = report_mosek_error(r,res)
  %
  % Example:
  %   [r,res]=mosekopt('minimize echo(0)',prob,param);
  %   [r,res] = report_mosek_error(r,res)
  %

  % check for mosek error
  if(r == 4006)
    warning(['MOSEK ERROR. rcode: ' ...
      num2str(res.rcode) ' ' ...
      res.rcodestr ' ' ...
      res.rmsg ...
      'The solution is probably OK, but ' ...
      'to make this error go away, increase: ' ...
      'MSK_DPAR_INTPNT_CO_TOL_REL_GAP' ...
      ]);
  elseif(r ~= 0)
    error(['FATAL MOSEK ERROR. rcode: ' ...
      num2str(res.rcode) ' ' ...
      res.rcodestr ' ' ...
      res.rmsg]);
  end