code: public function getExceptionCode(\Exception $exception)
      {
          $class = get_class($exception);
          $exceptions = $this->getExceptions();
  
          if (!isset($exceptions[$class])) {
              throw new \RuntimeException(sprintf(
                  'Not exist exception "%s" in storage.',
                  $class
              ));
          }
  
          return $exceptions[$class];
      }
docs: Get exception code
  
  @param \Exception $exception
  
  @return int
  
  @throws \RuntimeException