Module:Documentation: Difference between revisions

use the err function for all the errors
m>Mr. Stradivarius
(finish moving end box code into sub-functions)
m>Mr. Stradivarius
(use the err function for all the errors)
Line 508: Line 508:
local success, docTitle = env:grab('docTitle')
local success, docTitle = env:grab('docTitle')
if not success then
if not success then
return docTitle -- docTitle is an error message
return err(docTitle) -- docTitle is an error message
end
end
-- Get the documentation content.
-- Get the documentation content.
Line 534: Line 534:
local success, docTitle = env:grab('docTitle')
local success, docTitle = env:grab('docTitle')
if not success then
if not success then
return docTitle -- Error message
return err(docTitle) -- Error message
end
end
Line 596: Line 596:
local success, printTitle = env:grab('printTitle')
local success, printTitle = env:grab('printTitle')
if not success then
if not success then
return printTitle -- Error message
return err(printTitle) -- Error message
end
end
-- Make the print blurb.
-- Make the print blurb.
Line 615: Line 615:
local success, templateTitle = env:grab('templateTitle')
local success, templateTitle = env:grab('templateTitle')
if not success then
if not success then
return templateTitle -- Error message.
return err(templateTitle) -- Error message.
end
end
-- Make the subpages blurb.
-- Make the subpages blurb.
Line 636: Line 636:
local success, docTitle = env:grab('docTitle')
local success, docTitle = env:grab('docTitle')
if not success then
if not success then
-- docTitle is the error message.
return err(docTitle) -- Error message
return docTitle
end
end
-- Make the blurb.
-- Make the blurb.
Line 648: Line 647:
local success, docTitle = env:grab('docTitle')
local success, docTitle = env:grab('docTitle')
if not success then
if not success then
-- docTitle is the error message.
return err(docTitle) -- Error message
return docTitle
end
end
-- Make the blurb.
-- Make the blurb.
Anonymous user