New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail gracefully if a file is not found #4

Closed
kghbln opened this Issue Jul 11, 2016 · 2 comments

Comments

2 participants
@kghbln

kghbln commented Jul 11, 2016

Currently we get the following exception if a file is included what cannot be found.

Exception encountered, of type "FileFetcher\FileFetchingException"
[2b3e4ba2] /wiki/Help:Sorting FileFetcher\FileFetchingException from line 30 of /.../w/vendor/jeroen/file-fetcher/src/SimpleFileFetcher.php: Could not fetch file: https://cdn.rawgit.com/SemanticMediaWiki/SemanticMediaWiki/master/issues/902
Backtrace:
#0 /.../w/vendor/jeroen/file-fetcher/src/CachingFileFetcher.php(44): FileFetcher\SimpleFileFetcher->fetchFile(string)
#1 /.../w/vendor/jeroen/file-fetcher/src/CachingFileFetcher.php(37): FileFetcher\CachingFileFetcher->retrieveAndCacheFile(string)
#2 /.../w/vendor/jeroen/mediawiki-github/src/GitHubParserHook.php(58): FileFetcher\CachingFileFetcher->fetchFile(string)
#3 /.../w/vendor/jeroen/mediawiki-github/src/GitHubParserHook.php(48): GitHub\GitHubParserHook->getFileContent()
#4 /.../w/vendor/jeroen/mediawiki-github/src/GitHubParserHook.php(36): GitHub\GitHubParserHook->getRenderedContent()
#5 /.../w/vendor/mediawiki/parser-hooks/src/FunctionRunner.php(49): GitHub\GitHubParserHook->handle(Parser, ParamProcessor\ProcessingResult)
#6 /.../w/vendor/mediawiki/parser-hooks/src/HookRegistrant.php(45): ParserHooks\FunctionRunner->run(Parser, array, PPTemplateFrame_DOM)
#7 [internal function]: ParserHooks\HookRegistrant->ParserHooks\{closure}(Parser, PPTemplateFrame_DOM, array)
#8 /.../w/includes/parser/Parser.php(3783): call_user_func_array(Closure, array)
#9 /.../w/includes/parser/Parser.php(3517): Parser->callParserFunction(PPTemplateFrame_DOM, string, array)
#10 /.../w/includes/parser/Preprocessor_DOM.php(1169): Parser->braceSubstitution(array, PPTemplateFrame_DOM)
#11 /.../w/extensions/ParserFunctions/ParserFunctions_body.php(106): PPFrame_DOM->expand(PPNode_DOM)
#12 [internal function]: ExtParserFunctions::ifObj(Parser, PPTemplateFrame_DOM, array)
#13 /.../w/includes/parser/Parser.php(3783): call_user_func_array(string, array)
#14 /.../w/includes/parser/Parser.php(3517): Parser->callParserFunction(PPTemplateFrame_DOM, string, array)
#15 /.../w/includes/parser/Preprocessor_DOM.php(1169): Parser->braceSubstitution(array, PPTemplateFrame_DOM)
#16 /.../w/extensions/ParserFunctions/ParserFunctions_body.php(106): PPFrame_DOM->expand(PPNode_DOM)
#17 [internal function]: ExtParserFunctions::ifObj(Parser, PPTemplateFrame_DOM, array)
#18 /.../w/includes/parser/Parser.php(3783): call_user_func_array(string, array)
#19 /.../w/includes/parser/Parser.php(3517): Parser->callParserFunction(PPTemplateFrame_DOM, string, array)
#20 /.../w/includes/parser/Preprocessor_DOM.php(1169): Parser->braceSubstitution(array, PPTemplateFrame_DOM)
#21 /.../w/includes/parser/Parser.php(3659): PPFrame_DOM->expand(PPNode_DOM)
#22 /.../w/includes/parser/Preprocessor_DOM.php(1169): Parser->braceSubstitution(array, PPFrame_DOM)
#23 /.../w/includes/parser/Parser.php(3334): PPFrame_DOM->expand(PPNode_DOM, integer)
#24 /.../w/includes/parser/Parser.php(1232): Parser->replaceVariables(string)
#25 /.../w/includes/parser/Parser.php(435): Parser->internalParse(string)
#26 [internal function]: Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#27 /.../w/includes/StubObject.php(105): call_user_func_array(array, array)
#28 /.../w/includes/StubObject.php(129): StubObject->_call(string, array)
#29 /.../w/includes/content/WikitextContent.php(333): StubObject->__call(string, array)
#30 /.../w/includes/content/WikitextContent.php(333): StubObject->parse(string, Title, ParserOptions, boolean, boolean, integer)
#31 /.../w/includes/content/AbstractContent.php(497): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#32 /.../w/includes/poolcounter/PoolWorkArticleView.php(140): AbstractContent->getParserOutput(Title, integer, ParserOptions)
#33 /.../w/includes/poolcounter/PoolCounterWork.php(123): PoolWorkArticleView->doWork()
#34 /.../w/includes/page/Article.php(674): PoolCounterWork->execute()
#35 /.../w/includes/actions/ViewAction.php(44): Article->view()
#36 /.../w/includes/MediaWiki.php(463): ViewAction->show()
#37 /.../w/includes/MediaWiki.php(269): MediaWiki->performAction(Article, Title)
#38 /.../w/includes/MediaWiki.php(634): MediaWiki->performRequest()
#39 /.../w/includes/MediaWiki.php(482): MediaWiki->main()
#40 /.../w/index.php(41): MediaWiki->run()
#41 {main}
@JeroenDeDauw

This comment has been minimized.

Owner

JeroenDeDauw commented Jul 11, 2016

Yeah I realized yesterday that I forgot to actually deal with the exception. That is an issue in GitHub extension.

@kghbln

This comment has been minimized.

kghbln commented Jul 11, 2016

No worries. Just opened an new issue JeroenDeDauw/GitHub#23 for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment