Register control exception.
769922
protected function registerException()
    {
        $this->app->singleton('Nano7\Foundation\Contracts\Exception\ExceptionHandler', function ($app) {
            $except = new \Nano7\Foundation\Exception\ExceptionHandler();

            // Verificar se view foi adicionada
            if ($app->resolved('view')) {
                $except->setViewService($app['view']);
            }

            return $except;
        });
    }
407051
protected function registerErrorHandler()
    {
        Event::listen('exception.beforeRender', function ($exception, $httpCode, $request) {
            $handler = new ErrorHandler;
            return $handler->handleException($exception);
        });
    }
339389
def set_exception(self, exception):
        '''  '''
        logger.error("%s : %s" % (exception.__class__.__name__, str(exception)))
        self._set_status(enumAsperaControllerStatus.FAILED, exception)
1363226
public void registerThrowable(RetryContext context, Throwable throwable) {
		((NeverRetryContext) context).setFinished();
		((RetryContextSupport) context).registerThrowable(throwable);
	}
204133
public static function register() {
		ini_set('display_errors', 0);
		ini_set('display_startup_errors', 0);
		error_reporting(-1);

		static::$reservedMemory = str_repeat('a', 10240);
		static::$errorAtStart = error_get_last();

		$errorHandler = new static();
		set_error_handler([$errorHandler, 'phpErrorHandler']);
		set_exception_handler([$errorHandler, 'exceptionHandler']);

		return $errorHandler;
	}
696038
protected function registerErrorHandle(): void
    {
        \set_error_handler([$this, 'handleError']);
        \set_exception_handler([$this, 'handleException']);
        \register_shutdown_function(function () {
            if ($e = \error_get_last()) {
                $this->handleError($e['type'], $e['message'], $e['file'], $e['line']);
            }
        });
    }
216169
function register()
	{
		set_error_handler(array($this,'_handleError'));
		set_exception_handler(array($this,'_handleException'));
		register_shutdown_function(array($this,'_shutdown'));
		$this->_registered = true;
		return $this;
	}
425089
public static void registerSubordinateControl(final String controlId) {
		UIContext uic = UIContextHolder.getCurrentPrimaryUIContext();
		if (uic == null) {
			throw new SystemException("No User Context available to register Subordinate Control.");
		}
		Set<String> controls = (Set<String>) uic.getFwkAttribute(SUBORDINATE_CONTROL_SESSION_KEY);
		if (controls == null) {
			controls = new HashSet<>();
			uic.setFwkAttribute(SUBORDINATE_CONTROL_SESSION_KEY, controls);
		}
		controls.add(controlId);
	}
546049
public void register() throws Exception {
        ChannelFuture future = loop.register(this);
        assert future.isDone();
        Throwable cause = future.cause();
        if (cause != null) {
            PlatformDependent.throwException(cause);
        }
    }
1360149
public function register()
    {
        $errorMsg = "Your ConsoleServiceProvider(AbstractConsoleProvider) requires property";
        if (! isset($this->namespace) or ! is_string($this->namespace)) {
            throw new ErrorException("$errorMsg \$namespace to be an string");
        }
        if (! isset($this->commands) or ! is_array($this->commands)) {
            throw new ErrorException("$errorMsg \$commands to be an array");
        }

        $bindings = [ ];
        foreach ($this->commands as $binding => $command) {
            $binding    = $this->prefix . $binding;
            $bindings[] = $binding;
            $this->{"registerCommand"}($binding, $command);
        }

        $this->commands($bindings);
    }
826185
public <T> void register(Class<T> event, EventObserver<T> observer){
        if(event == null){
            throw new IllegalArgumentException("Null Event type passed to register");
        }
        if(observer == null){
            throw new IllegalArgumentException("Null observer passed to register");
        }
        nullSafeGet(event).add(observer);
    }
1063526
private void initExceptionsPanel() {

        m_exceptionsPanel.setLegend(Messages.get().key(Messages.GUI_SERIALDATE_PANEL_EXCEPTIONS_0));
        m_exceptionsPanel.addCloseHandler(this);
        m_exceptionsPanel.setVisible(false);
    }
1342883
def register(self):
        """"""
        loop = asyncio.new_event_loop()
        asyncio.set_event_loop(loop)
        loop.run_until_complete(self._register())
570161
protected function registerHandlers() {
		set_exception_handler(function($exception) {
			$this->pushException($exception);
			
			echo $this->renderDebugBar();
		});
		
		register_shutdown_function(function() {
			if ($this->onShutdownCallback !== null) {
				$this->onShutdownCallback->__invoke($this);
			}
			
			// Debug bar rendering for the deferred mode
			if ($this->deferredMode) {
				// Garbage collection
				if ($this->profilesGcEnabled) {
					$this->gcCycle();
				}
				
				// Content creating
				$filePath = $this->deferredDir . DIRECTORY_SEPARATOR . 'profile_' . $this->token . '.html';
				if (file_put_contents($filePath, $this->renderDebugBar()) === false) {
					throw new InvalidPath('Unable to write the debug data into: "' . $filePath . '"');
				}
			}
		});
	}
1126739
public function register()
    {
        $errorLevel = $this->config('errorLevel');
        set_error_handler([$this, 'handleError'], $errorLevel);
        set_exception_handler([$this, 'handle']);
        register_shutdown_function(function () {
            if (PHP_SAPI === 'cli') {
                return;
            }
            $error = error_get_last();
            if (!is_array($error)) {
                return;
            }
            $fatals = [
                E_USER_ERROR,
                E_ERROR,
                E_PARSE,
            ];
            if (!in_array($error['type'], $fatals, true)) {
                return;
            }
            $this->handleFatalError(
                $error['type'],
                $error['message'],
                $error['file'],
                $error['line']
            );
        });
    }
89629
function it_throws_an_exception_when_attempting_to_register_the_same_type_twice($converter)
    {
        $this->setType('decimal', $converter);
        $this->shouldThrow(new ResourceHandlerAlreadyDefinedException( 'An handler for resource "decimal" has already been registered.'))->duringSetType('decimal', $converter);
    }
189185
protected void registerPreviewHandler() {

        if (m_previewHandlerRegistration == null) {
            NativePreviewHandler eventPreviewHandler = new NativePreviewHandler() {

                public void onPreviewNativeEvent(NativePreviewEvent event) {

                    Event nativeEvent = Event.as(event.getNativeEvent());
                    if (DOM.eventGetType(nativeEvent) == Event.ONKEYDOWN) {
                        int keyCode = nativeEvent.getKeyCode();
                        if (keyCode == KeyCodes.KEY_ESCAPE) {
                            onClickCancel();
                        } else if (keyCode == KeyCodes.KEY_ENTER) {
                            Element element = CmsDomUtil.getActiveElement();
                            boolean isTextarea = (element != null) && element.getTagName().equalsIgnoreCase("textarea");
                            if (!isTextarea) {
                                onClickOk();
                            }
                        }
                    }
                }
            };
            m_previewHandlerRegistration = Event.addNativePreviewHandler(eventPreviewHandler);
        }
    }