{@inheritdoc}
@throws Exception\StateNotFound
491476
public function registerState(
        string $stateName,
        StateInterface $stateObject,
        string $originalClassName = ''
    ): ProxyInterface {
        $this->validateName($stateName);

        if (!\is_a($stateObject, $stateName) && !\is_subclass_of($stateObject, $stateName)) {
            throw new Exception\IllegalName(
                sprintf(
                    'Error, the state does not implement the class or interface "%s"',
                    $stateName
                )
            );
        }

        $this->states[$stateName] = $stateObject;

        if (empty($originalClassName)) {
            $originalClassName = \get_class($this);
        }

        $this->classesByStates[$stateName] = $originalClassName;

        return $this;
    }
1205450
public function dispatchException($exception) {
		if($this->isActive()) {
			if($this->dispatchPreviousExceptions && $exception->getPrevious()) {
				$this->dispatchException($exception->getPrevious());
			}
			$message = new ErrorMessage();
			$message->code = $exception->getCode();
			$message->class = get_class($exception);
			$message->data = $this->dumper->dump($exception->getMessage());
			$message->file = $exception->getFile();
			$message->line = $exception->getLine();
			$message->trace = self::fetchTrace($exception->getTrace(), $message->file, $message->line);
			$this->sendMessage($message);
		}
	}
380425
public function addToSection($section, $test, $filePath, $lineNumber, $codeLine) {
		if (empty($section)) {
			throw new \Exception(__METHOD__.": The section can not be empty.");
		}
		$this->sectionBuffers[$section][$filePath][$test][] = [$lineNumber, $codeLine];
	}
412771
public function addTransition($stateId, $nextStateId, $eventId)
    {
        $state = $this->stateMachine->getState($stateId);
        if ($state === null) {
            throw new StateNotFoundException(sprintf('The state "%s" is not found.', $stateId));
        }

        $nextState = $this->stateMachine->getState($nextStateId);
        if ($nextState === null) {
            throw new StateNotFoundException(sprintf('The state "%s" is not found.', $nextStateId));
        }

        $event = $state->getTransitionEvent($eventId);
        if ($event === null) {
            $event = new Event($eventId);
        }

        $this->stateMachine->addTransition(new Transition($nextState, $state, $event));
    }
209740
public function filter($request)
	{
		foreach($this->_filters as $filter)
		{
			if(!$request = $filter->filter($request))
			{
				throw new Exception("Filter returned a null request");
			}
		}

		return $request;
	}
396738
public function getNodeRendererByStateName($stateName)
    {
        if (isset($this->nodeRenderers[$stateName])) {
            return $this->nodeRenderers[$stateName];
        }
        return new NodeRenderer();
    }
1274503
public function collect(Request $request, Response $response, \Exception $exception = null)
    {
        $this->data = array(
            'repository' => $this->repository !== null ? $this->repository : null,
            'enabled'    => $this->enabled
        );
    }
812051
public function offsetGet($offset)
    {
        $data = $this->getQueryResult($offset);
        if (null == $data) {
            throw new Exception('Data row by key "' . $offset . '" not exists');
        }
        return $data;
    }
241109
public function filterByStorageLocation($storageLocation) {
        if ($storageLocation instanceof \Concrete\Core\Entity\File\StorageLocation\StorageLocation) {
            $this->filterByStorageLocationID($storageLocation->getID());
        } elseif (!is_object($storageLocation)) {
            $this->filterByStorageLocationID($storageLocation);
        } else {
            throw new Exception(t('Invalid file storage location.'));
        }
    }
1046297
public function onException(GetResponseForExceptionEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $attributes = $event->getRequest()->attributes;
        if ($attributes->get(SetIsApiRequestListener::API_FLAG_NAME) !== true) {
            return;
        }

        $exception = $event->getException();

        $this->logException($exception);

        $data = [
            'code' => $exception->getCode(),
            'message' => $exception->getMessage(),
        ];

        if ($exception instanceof HttpExceptionInterface) {
            $statusCode = $exception->getStatusCode();
            if (isset(Response::$statusTexts[$statusCode])) {
                $data['status_code'] = $statusCode;
                $data['status_text'] = Response::$statusTexts[$statusCode];
            }
        }

        if ($this->outputDebugInfo) {
            $debugException = $exception;
            if ($exception->getPrevious() instanceof Exception) {
                $debugException = $exception->getPrevious();
            }

            $debugException = FlattenException::create($debugException);

            $data['debug'] = [
                'file' => $debugException->getFile(),
                'line' => $debugException->getLine(),
                'trace' => $debugException->getTrace(),
            ];
        }

        $event->setResponse(new JsonResponse($data));
    }
733203
public function postAction(Request $request)
    {
        try {
            $filter = $this->getManager()->save(
                $request->request->all(),
                $this->getRequestParameter($request, 'locale', true),
                $this->getUser()->getId()
            );
            $view = $this->view($filter, 200);
        } catch (FilterDependencyNotFoundException $e) {
            $exception = new EntityNotFoundException($e->getEntityName(), $e->getId());
            $view = $this->view($exception->toArray(), 400);
        } catch (MissingFilterException $e) {
            $exception = new MissingArgumentException(self::$entityName, $e->getFilter());
            $view = $this->view($exception->toArray(), 400);
        } catch (MissingFilterAttributeException $e) {
            $exception = new MissingArgumentException(self::$entityName, $e->getAttribute());
            $view = $this->view($exception->toArray(), 400);
        } catch (ConditionGroupMismatchException $e) {
            $exception = new InvalidArgumentException(self::$groupConditionEntityName, $e->getId());
            $view = $this->view($exception->toArray(), 400);
        } catch (UnknownContextException $e) {
            $exception = new RestException($e->getMessage());
            $view = $this->view($exception->toArray(), 400);
        }

        return $this->handleView($view);
    }
514856
public function notFound($fnc)
    {
        if (is_callable($fnc)) {
            if ($fnc instanceof \Closure) {
                $this->notFoundModified = $fnc;
            } else {
                $this->addedExceptions['\InvalidArgumentException'] = 'O callable do metodo notFound deve ser um closure!';
            }
        } else {
            $this->addedExceptions['\InvalidArgumentException'] = 'App::notFound, callable invalido';
        }
    }
96666
protected function throwError($msg = null)
    {
        if ($this->sourceLoc >= 0) {
            $this->sourceParser->throwError($msg, $this->sourceLoc);
        }
        throw new exception($msg);
    }
1289376
function (stateName) {
            this.$Frame.changeState.call(this, stateName); // this must be
            // called before
            // assigning
            // cssPrefix
            var cfg = this._cfg, cssPrefix = this._cssPrefix, tr, td, getDomElementChild = ariaUtilsDom.getDomElementChild;

            this._computeSize();

            var tds = this._tds;
            if (!tds) {
                tds = [];
                this._tds = tds;
                var tbody = getDomElementChild(this._domElt, 0);
                // Line 1
                tr = getDomElementChild(tbody, 0);
                td = getDomElementChild(tr, 0);
                tds.push({
                    element : td,
                    cssPart1 : 'tlc ',
                    cssPart2 : 'bkgA'
                });
                td = getDomElementChild(tr, 1);
                tds.push({
                    element : td,
                    cssPart1 : 'ts ',
                    cssPart2 : 'bkgB'
                });
                td = getDomElementChild(tr, 2);
                tds.push({
                    element : td,
                    cssPart1 : 'trc ',
                    cssPart2 : 'bkgA'
                });
                // Line 2
                tr = getDomElementChild(tbody, 1);
                td = getDomElementChild(tr, 0);
                tds.push({
                    element : td,
                    cssPart1 : 'ls ',
                    cssPart2 : 'bkgC'
                });
                td = getDomElementChild(tr, 1);
                tds.push({
                    element : td,
                    cssPart : 'm'
                });
                td = getDomElementChild(tr, 2);
                tds.push({
                    element : td,
                    cssPart1 : 'rs ',
                    cssPart2 : 'bkgC'
                });
                // Line 3
                tr = getDomElementChild(tbody, 2);
                td = getDomElementChild(tr, 0);

                tds.push({
                    element : td,
                    cssPart1 : 'blc ',
                    cssPart2 : 'bkgA'
                });
                td = getDomElementChild(tr, 1);
                tds.push({
                    element : td,
                    cssPart1 : 'bs ',
                    cssPart2 : 'bkgB'
                });

                td = getDomElementChild(tr, 2);

                tds.push({
                    element : td,
                    cssPart1 : 'brc ',
                    cssPart2 : 'bkgA'

                });

            }

            var sizeInfo = {
                className : 'xFrameContent ' + cssPrefix + 'c ' + cfg.cssClass
            };
            this._appendInnerSizeInfo(sizeInfo);
            this._childRootElt.style.width = sizeInfo.width;
            this._childRootElt.style.height = sizeInfo.height;
            this._childRootElt.className = sizeInfo.className;

            for (var i = 0, l = tds.length; i < l; i++) {
                td = tds[i];
                if (td.cssPart) {
                    td.element.className = cssPrefix + 'm';
                } else {
                    td.element.className = cssPrefix + td.cssPart1 + cssPrefix + td.cssPart2;
                }
                // frameIcons update
                if (i == 1) {
                    td.element.innerHTML = this.__addFrameIcon(cfg, cssPrefix, 'top');
                }
                if (i == 7) {
                    td.element.innerHTML = this.__addFrameIcon(cfg, cssPrefix, 'bottom');
                }
            }
        }
1267370
public static void stateNotNull(final Object obj, final String message) throws IllegalStateException {
        if (obj == null) {
            throw new IllegalStateException(message);
        }
    }
610837
function it_receives_null_when_the_api_returns_404(){

        //---------------------------------
        // Test Setup

        $code = 404;

        $this->httpClient->sendRequest( Argument::type('Psr\Http\Message\RequestInterface') )->willReturn(
            new Response(
                $code,
                ['Content-type'  => 'application/json']
            )
        );

        //---------------------------------
        // Perform action

        $response = $this->getNotification( '35836a9e-5a97-4d99-8309-0c5a2c3dbc72' );

        //---------------------------------
        // Check result

        $response->shouldBeNull();

    }
1343186
function (stateName) {
            this._stateName = stateName;
            this._updateIcons();
            if (this._updateFrameWidth()) {
                this._frame.resize(this._frameWidth, this._outerHeight);
            }
            ariaUtilsArray.forEach(this._iconsLeft, this._changeIconState, this);
            this._frame.changeState(stateName);
            ariaUtilsArray.forEach(this._iconsRight, this._changeIconState, this);
            this.innerWidth = this._frame.innerWidth;
            this.innerHeight = this._frame.innerHeight;
        }