当前位置: 首页>>代码示例>>PHP>>正文


PHP Exception::report方法代码示例

本文整理汇总了PHP中Exception::report方法的典型用法代码示例。如果您正苦于以下问题:PHP Exception::report方法的具体用法?PHP Exception::report怎么用?PHP Exception::report使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Exception的用法示例。


在下文中一共展示了Exception::report方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: report

 /**
  * Override WikiaException report() and write exceptions to error_log
  */
 function report()
 {
     // Display normal mediawiki error page for mediawiki exceptions
     if ($this->_original instanceof MWException) {
         $this->_original->report();
     } else {
         WikiaLogger::instance()->error(__CLASS__, ['err' => $this->getMessage(), 'exception' => $this->getOriginal()]);
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:12,代码来源:WikiaException.php

示例2: report

 /**
  * Override WikiaException report() and write exceptions to error_log
  */
 function report()
 {
     global $wgRequest;
     $info = '';
     if (!empty($this->_original)) {
         $file = $this->_original->getFile();
         $line = $this->_original->getLine();
         $message = $this->_original->getMessage();
         $info = "exception has occurred at line {$line} of {$file}: {$message}";
     } else {
         $info = "unknown exception has occurred";
     }
     $url = '[no URL]';
     if (isset($wgRequest)) {
         $url = $wgRequest->getFullRequestURL();
     }
     // Display normal mediawiki eror page for mediawiki exceptions
     if ($this->_original instanceof MWException) {
         $this->_original->report();
     } else {
         trigger_error("[REPORT: {$this->getMessage()}] WikiaDispatcher reports an {$info}  (URL: {$url}) [REPORT: End]", E_USER_ERROR);
     }
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:26,代码来源:WikiaDispatchedException.class.php

示例3: report

 /**
  * Report an exception to the user
  * @param Exception|Throwable $e
  */
 protected static function report($e)
 {
     try {
         // Try and show the exception prettily, with the normal skin infrastructure
         if ($e instanceof MWException) {
             // Delegate to MWException until all subclasses are handled by
             // MWExceptionRenderer and MWException::report() has been
             // removed.
             $e->report();
         } else {
             MWExceptionRenderer::output($e, MWExceptionRenderer::AS_PRETTY);
         }
     } catch (Exception $e2) {
         // Exception occurred from within exception handler
         // Show a simpler message for the original exception,
         // don't try to invoke report()
         MWExceptionRenderer::output($e, MWExceptionRenderer::AS_RAW, $e2);
     }
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:23,代码来源:MWExceptionHandler.php

示例4: report

 /**
  * Report an exception to the user
  * @param Exception $e
  */
 protected static function report(Exception $e)
 {
     global $wgShowExceptionDetails;
     $cmdLine = MWException::isCommandLine();
     if ($e instanceof MWException) {
         try {
             // Try and show the exception prettily, with the normal skin infrastructure
             $e->report();
         } catch (Exception $e2) {
             // Exception occurred from within exception handler
             // Show a simpler message for the original exception,
             // don't try to invoke report()
             $message = "MediaWiki internal error.\n\n";
             if ($wgShowExceptionDetails) {
                 $message .= 'Original exception: ' . self::getLogMessage($e) . "\nBacktrace:\n" . self::getRedactedTraceAsString($e) . "\n\nException caught inside exception handler: " . self::getLogMessage($e2) . "\nBacktrace:\n" . self::getRedactedTraceAsString($e2);
             } else {
                 $message .= "Exception caught inside exception handler.\n\n" . "Set \$wgShowExceptionDetails = true; at the bottom of LocalSettings.php " . "to show detailed debugging information.";
             }
             $message .= "\n";
             if ($cmdLine) {
                 self::printError($message);
             } else {
                 echo nl2br(htmlspecialchars($message)) . "\n";
             }
         }
     } else {
         $message = "Exception encountered, of type \"" . get_class($e) . "\"";
         if ($wgShowExceptionDetails) {
             $message .= "\n" . MWExceptionHandler::getLogMessage($e) . "\nBacktrace:\n" . self::getRedactedTraceAsString($e) . "\n";
         }
         if ($cmdLine) {
             self::printError($message);
         } else {
             echo nl2br(htmlspecialchars($message)) . "\n";
         }
     }
 }
开发者ID:D66Ha,项目名称:mediawiki,代码行数:41,代码来源:MWExceptionHandler.php

示例5: report

 /**
  * Report an exception to the user
  */
 protected static function report(Exception $e)
 {
     global $wgShowExceptionDetails;
     $cmdLine = MWException::isCommandLine();
     if ($e instanceof MWException) {
         try {
             // Try and show the exception prettily, with the normal skin infrastructure
             $e->report();
         } catch (Exception $e2) {
             // Exception occurred from within exception handler
             // Show a simpler error message for the original exception,
             // don't try to invoke report()
             $message = "MediaWiki internal error.\n\n";
             if ($wgShowExceptionDetails) {
                 $message .= 'Original exception: ' . $e->__toString() . "\n\n" . 'Exception caught inside exception handler: ' . $e2->__toString();
             } else {
                 $message .= "Exception caught inside exception handler.\n\n" . "Set \$wgShowExceptionDetails = true; at the bottom of LocalSettings.php " . "to show detailed debugging information.";
             }
             $message .= "\n";
             if ($cmdLine) {
                 self::printError($message);
             } else {
                 self::escapeEchoAndDie($message);
             }
         }
     } else {
         $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class($e) . "\"\n" . $e->__toString() . "\n";
         if ($wgShowExceptionDetails) {
             $message .= "\n" . $e->getTraceAsString() . "\n";
         }
         if ($cmdLine) {
             self::printError($message);
         } else {
             self::escapeEchoAndDie($message);
         }
     }
 }
开发者ID:yusufchang,项目名称:app,代码行数:40,代码来源:Exception.php

示例6: wfReportException

/**
 * Report an exception to the user
 */
function wfReportException(Exception $e)
{
    if ($e instanceof MWException) {
        try {
            $e->report();
        } catch (Exception $e2) {
            // Exception occurred from within exception handler
            // Show a simpler error message for the original exception,
            // don't try to invoke report()
            $message = "MediaWiki internal error.\n\n" . "Original exception: " . $e->__toString() . "\n\nException caught inside exception handler: " . $e2->__toString() . "\n";
            if (!empty($GLOBALS['wgCommandLineMode'])) {
                echo $message;
            } else {
                echo nl2br(htmlspecialchars($message)) . "\n";
            }
        }
    } else {
        echo $e->__toString();
    }
}
开发者ID:negabaro,项目名称:alfresco,代码行数:23,代码来源:Exception.php

示例7: wfReportException

/**
 * Report an exception to the user
 */
function wfReportException(Exception $e)
{
    global $wgShowExceptionDetails;
    $cmdLine = MWException::isCommandLine();
    if ($e instanceof MWException) {
        try {
            $e->report();
        } catch (Exception $e2) {
            // Exception occurred from within exception handler
            // Show a simpler error message for the original exception,
            // don't try to invoke report()
            $message = "MediaWiki internal error.\n\n";
            if ($wgShowExceptionDetails) {
                $message .= 'Original exception: ' . $e->__toString() . "\n\n" . 'Exception caught inside exception handler: ' . $e2->__toString();
            } else {
                $message .= "Exception caught inside exception handler.\n\n" . "Set \$wgShowExceptionDetails = true; at the bottom of LocalSettings.php " . "to show detailed debugging information.";
            }
            $message .= "\n";
            if ($cmdLine) {
                wfPrintError($message);
            } else {
                echo nl2br(htmlspecialchars($message)) . "\n";
            }
        }
    } else {
        $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class($e) . "\"\n" . $e->__toString() . "\n";
        if ($wgShowExceptionDetails) {
            $message .= "\n" . $e->getTraceAsString() . "\n";
        }
        if ($cmdLine) {
            wfPrintError($message);
        } else {
            echo nl2br(htmlspecialchars($message)) . "\n";
        }
    }
}
开发者ID:GodelDesign,项目名称:Godel,代码行数:39,代码来源:Exception.php

示例8: wfReportException

/**
 * Report an exception to the user
 */
function wfReportException(Exception $e)
{
    $cmdLine = MWException::isCommandLine();
    if ($e instanceof MWException) {
        try {
            $e->report();
        } catch (Exception $e2) {
            // Exception occurred from within exception handler
            // Show a simpler error message for the original exception,
            // don't try to invoke report()
            $message = "MediaWiki internal error.\n\n";
            if ($GLOBALS['wgShowExceptionDetails']) {
                $message .= "Original exception: " . $e->__toString();
            }
            $message .= "\n\nException caught inside exception handler";
            if ($GLOBALS['wgShowExceptionDetails']) {
                $message .= ": " . $e2->__toString();
            }
            $message .= "\n";
            if ($cmdLine) {
                wfPrintError($message);
            } else {
                echo nl2br(htmlspecialchars($message)) . "\n";
            }
        }
    } else {
        $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class($e) . "\"\n" . $e->__toString() . "\n";
        if ($GLOBALS['wgShowExceptionDetails']) {
            $message .= "\n" . $e->getTraceAsString() . "\n";
        }
        if ($cmdLine) {
            wfPrintError($message);
        } else {
            echo nl2br(htmlspecialchars($message)) . "\n";
        }
    }
}
开发者ID:ui-libraries,项目名称:TIRW,代码行数:40,代码来源:Exception.php


注:本文中的Exception::report方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。