Exceptions
Module
PDFHighlights.Internal.Exceptions — ModuleThis module contains all the exceptions used in the package, as well as the macro(s) that they were created by.
Types
PDFHighlights.Internal.Exceptions.DirectoryDoesNotExist — TypeDirectoryDoesNotExist <: ExceptionException thrown when the specified directory doesn't exist.
Fields
file::String: absolute or relative path to a file that is associated with the exception
See also: @exception_with_file
PDFHighlights.Internal.Exceptions.DoesNotExist — TypeDoesNotExist <: ExceptionException thrown when the specified file or directory doesn't exist.
Fields
file::String: absolute or relative path to a file that is associated with the exception
See also: @exception_with_file
PDFHighlights.Internal.Exceptions.FileDoesNotExist — TypeFileDoesNotExist <: ExceptionException thrown when the specified file doesn't exist.
Fields
file::String: absolute or relative path to a file that is associated with the exception
See also: @exception_with_file
PDFHighlights.Internal.Exceptions.IncorrectHeader — TypeIncorrectHeader <: ExceptionException thrown when the specified file has an incorrect header.
Fields
file::String: absolute or relative path to a file that is associated with the exception
See also: @exception_with_file
PDFHighlights.Internal.Exceptions.IntegrityCheckFailed — TypeIntegrityCheckFailed <: ExceptionAn exception thrown when another exception was thrown while checking the integrity of the table.
Fields
file::String: absolute or relative path to a file that is associated with the exception
See also: @exception_with_file
PDFHighlights.Internal.Exceptions.LastElementIsNotAnInteger — TypeLastElementIsNotAnInteger <: ExceptionException thrown when the last element in the line is not an integer.
Fields
file::String: absolute or relative path to a file that is associated with the exceptionline::Int: line number of the specified file to which this exception is associated
See also: @exception_with_line
PDFHighlights.Internal.Exceptions.NotCSV — TypeNotCSV <: ExceptionException thrown when the specified path does not end in .csv.
Fields
file::String: absolute or relative path to a file that is associated with the exception
See also: @exception_with_file
PDFHighlights.Internal.Exceptions.NotCSVorDir — TypeNotCSVorDir <: ExceptionAn exception thrown when the specified path does not end in .csv ans is not a directory.
Fields
file::String: absolute or relative path to a file that is associated with the exception
See also: @exception_with_file
PDFHighlights.Internal.Exceptions.NotCSVorPDForDir — TypeNotCSVorPDForDir <: ExceptionAn exception thrown when the specified path does not end in .csv or .pdf and is not a directory.
Fields
file::String: absolute or relative path to a file that is associated with the exception
See also: @exception_with_file
PDFHighlights.Internal.Exceptions.NotFiveColumns — TypeNotFiveColumns <: ExceptionException thrown when the row does not represent elements for 5 columns.
Fields
file::String: absolute or relative path to a file that is associated with the exceptionline::Int: line number of the specified file to which this exception is associated
See also: @exception_with_line
PDFHighlights.Internal.Exceptions.NotPDF — TypeNotPDF <: ExceptionException thrown when the specified path does not end in .pdf.
Fields
file::String: absolute or relative path to a file that is associated with the exception
See also: @exception_with_file
Macros
PDFHighlights.Internal.Exceptions.@docstring — Macro@docstring(macro_name::Symbol) -> ExprRedefine the docstring variable in the innermost macro.
Arguments
macro_name::Symbol: name of the macro that generated the exception
Returns
Expr:docstringredefinition
Example
using PDFHighlights
using SyntaxTree
macro_name = QuoteNode(:name)
@macroexpand(PDFHighlights.Internal.Exceptions.@docstring(name)) |> linefilter! ==
quote
macro_name = $(macro_name)
docstring = Meta.quot(
"""
$(exception_name) <: Exception
$(docstring)
$(fields)
See also: [`@$(macro_name)`](@ref)
"""
)
end |> linefilter!PDFHighlights.Internal.Exceptions.@exception_with_file — Macro@exception_with_file(
exception_name::Symbol,
docstring::Union{Expr, String},
error_message_bits::Tuple{Vararg{Union{Expr, String}}},
) -> ExprCreate an exception with one field: a path to the file.
Arguments
exception_name::Symbol: name of the exceptiondocstring::Union{Expr, String}: documentation stringerror_message_bits::Tuple{Vararg{Union{Expr, String}}}: strings and expressions which will be interpolated in theshowerroroutput
Returns
Expr: an exception definition (struct +showerroroverload)
PDFHighlights.Internal.Exceptions.@exception_with_line — Macro@exception_with_line(
exception_name::Symbol,
docstring::Union{Expr, String},
error_message_bits::Tuple{Vararg{Union{Expr, String}}},
) -> ExprCreate an exception with two fields: a path to the file and a line number.
Arguments
exception_name::Symbol: name of the exceptiondocstring::Union{Expr, String}: documentation stringerror_message_bits::Tuple{Vararg{Union{Expr, String}}}: strings and expressions which will be interpolated in theshowerroroutput
Returns
Expr: an exception definition (struct +showerroroverload)
PDFHighlights.Internal.Exceptions.@exception_without_fields — Macro@exception_without_fields(
exception_name::Symbol,
docstring::Union{Expr, String},
error_message_bits::Tuple{Vararg{Union{Expr, String}}},
) -> ExprCreate an exception with no fields.
Arguments
exception_name::Symbol: name of the exceptiondocstring::Union{Expr, String}: documentation stringerror_message_bits::Tuple{Vararg{Union{Expr, String}}}: strings and expressions which will be interpolated in theshowerroroutput
Returns
Expr: an exception definition (struct +showerroroverload)
PDFHighlights.Internal.Exceptions.@fields — Macro@fields(strings::String...) -> ExprDefine the fields variable in the innermost macro. This variable is a string that describes type fields.
Arguments
strings::Tuple{Vararg{String}}: strings to store in thefieldsvariable
Returns
Expr:fieldsdefinition
Example
using PDFHighlights
using SyntaxTree
strings = ("`Cloverfield`: there's no place like home",)
@macroexpand(
PDFHighlights.Internal.Exceptions.@fields(
"`Cloverfield`: there's no place like home"
)
) |> linefilter! == quote
strings = $(strings) |> collect
strings = join(["- " * string for string in strings], '\n')
fields = """
# Fields\n
$(strings)
"""
end |> linefilter!