mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vdoc: highlight inline examples for -f html (#13879)
This commit is contained in:
@@ -85,7 +85,7 @@ fn trace_error(x string) {
|
||||
}
|
||||
|
||||
// error returns a default error instance containing the error given in `message`.
|
||||
// Example: `if ouch { return error('an error occurred') }`
|
||||
// Example: if ouch { return error('an error occurred') }
|
||||
[inline]
|
||||
pub fn error(message string) IError {
|
||||
trace_error(message)
|
||||
@@ -95,7 +95,7 @@ pub fn error(message string) IError {
|
||||
}
|
||||
|
||||
// error_with_code returns a default error instance containing the given `message` and error `code`.
|
||||
// `if ouch { return error_with_code('an error occurred', 1) }`
|
||||
// Example: if ouch { return error_with_code('an error occurred', 1) }
|
||||
[inline]
|
||||
pub fn error_with_code(message string, code int) IError {
|
||||
trace_error('$message | code: $code')
|
||||
|
||||
Reference in New Issue
Block a user