class_docstr: Base class for ask and tell optimizer derived from implementations with no ask and tell interface.
  The underlying optimizer implementation is a function which is supposed to call directly the function
  to optimize. It is tricked into optimizing a "fake" function in a thread:
  - calls to the fake functions are returned by the "ask()" interface
  - return values of the fake functions are provided to the thread when calling "tell(x, value)"
  
  Note
  ----
  These implementations are not necessarily robust. More specifically, one cannot "tell" any
  point which was not "asked" before.
  
  An optimization is performed by a third-party library in a background thread. This communicates
  with the main thread using two queue objects. Specifically:
  
      messages_ask is filled by the background thread with a candidate (or batch of candidates)
      it wants evaluated for, or None if the background thread is over, or an Exception
      which needs to be raised to the user.
  
      messages_tell supplies the background thread with a value to return from the fake function.
      A value of None means the background thread is no longer relevant and should exit.
class_docstr_tok: ["Base","class","for","ask","and","tell","optimizer","derived","from","implementations","with","no","ask","and","tell","interface",".","The","underlying","optimizer","implementation","is","a","function","which","is","supposed","to","call","directly","the","function","to","optimize",".","It","is","tricked","into","optimizing","a","``","fake","''","function","in","a","thread",":","-","calls","to","the","fake","functions","are","returned","by","the","``","ask","(",")","''","interface","-","return","values","of","the","fake","functions","are","provided","to","the","thread","when","calling","``","tell","(","x",",","value",")","''","Note","--","--","These","implementations","are","not","necessarily","robust",".","More","specifically",",","one","can","not","``","tell","''","any","point","which","was","not","``","asked","''","before",".","An","optimization","is","performed","by","a","third-party","library","in","a","background","thread",".","This","communicates","with","the","main","thread","using","two","queue","objects",".","Specifically",":","messages_ask","is","filled","by","the","background","thread","with","a","candidate","(","or","batch","of","candidates",")","it","wants","evaluated","for",",","or","None","if","the","background","thread","is","over",",","or","an","Exception","which","needs","to","be","raised","to","the","user",".","messages_tell","supplies","the","background","thread","with","a","value","to","return","from","the","fake","function",".","A","value","of","None","means","the","background","thread","is","no","longer","relevant","and","should","exit","."]
code: def _check_error(self) -> None:
      if self._messaging_thread is not None:
          if self._messaging_thread.error is not None:
              raise RuntimeError(
                  f"Recast optimizer raised an error:\n{self._messaging_thread.error}"
              ) from self._messaging_thread.error
  
imports: import warnings
  import threading
  import queue
  import numpy
  import nevergrad.common.typing
  from nevergrad.common.errors import NevergradError
  from nevergrad.parametrization import parameter
  from .None import base
  from .base import IntOrParameter
label_desc: Use image node_id 3 for calling the RecastOptimizer obj's underlying member method code with example usage: obj._check_error() without return types