Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
36b7e3da
Commit
36b7e3da
authored
Jun 12, 2012
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark JSON error detail messages for translation.
Per gripe from Tom Lane.
parent
99b3135e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/backend/utils/adt/json.c
src/backend/utils/adt/json.c
+6
-6
No files found.
src/backend/utils/adt/json.c
View file @
36b7e3da
...
@@ -431,7 +431,7 @@ json_lex_string(JsonLexContext *lex)
...
@@ -431,7 +431,7 @@ json_lex_string(JsonLexContext *lex)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
errmsg
(
"invalid input syntax for type json"
),
errmsg
(
"invalid input syntax for type json"
),
errdetail
_internal
(
"line %d: Character with value
\"
0x%02x
\"
must be escaped."
,
errdetail
(
"line %d: Character with value
\"
0x%02x
\"
must be escaped."
,
lex
->
line_number
,
(
unsigned
char
)
*
s
)));
lex
->
line_number
,
(
unsigned
char
)
*
s
)));
}
}
else
if
(
*
s
==
'\\'
)
else
if
(
*
s
==
'\\'
)
...
@@ -466,7 +466,7 @@ json_lex_string(JsonLexContext *lex)
...
@@ -466,7 +466,7 @@ json_lex_string(JsonLexContext *lex)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
errmsg
(
"invalid input syntax for type json"
),
errmsg
(
"invalid input syntax for type json"
),
errdetail
_internal
(
"line %d:
\"\\
u
\"
must be followed by four hexadecimal digits."
,
errdetail
(
"line %d:
\"\\
u
\"
must be followed by four hexadecimal digits."
,
lex
->
line_number
)));
lex
->
line_number
)));
}
}
}
}
...
@@ -480,7 +480,7 @@ json_lex_string(JsonLexContext *lex)
...
@@ -480,7 +480,7 @@ json_lex_string(JsonLexContext *lex)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
errmsg
(
"invalid input syntax for type json"
),
errmsg
(
"invalid input syntax for type json"
),
errdetail_interna
l
(
"line %d: Invalid escape
\"\\
%s
\"
."
,
errdetai
l
(
"line %d: Invalid escape
\"\\
%s
\"
."
,
lex
->
line_number
,
extract_mb_char
(
s
))));
lex
->
line_number
,
extract_mb_char
(
s
))));
}
}
}
}
...
@@ -595,7 +595,7 @@ report_parse_error(JsonParseStack *stack, JsonLexContext *lex)
...
@@ -595,7 +595,7 @@ report_parse_error(JsonParseStack *stack, JsonLexContext *lex)
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
errmsg
(
"invalid input syntax for type json:
\"
%s
\"
"
,
errmsg
(
"invalid input syntax for type json:
\"
%s
\"
"
,
lex
->
input
),
lex
->
input
),
errdetail
_internal
(
"The input string ended unexpectedly."
)));
errdetail
(
"The input string ended unexpectedly."
)));
/* Work out the offending token. */
/* Work out the offending token. */
toklen
=
lex
->
token_terminator
-
lex
->
token_start
;
toklen
=
lex
->
token_terminator
-
lex
->
token_start
;
...
@@ -638,7 +638,7 @@ report_parse_error(JsonParseStack *stack, JsonLexContext *lex)
...
@@ -638,7 +638,7 @@ report_parse_error(JsonParseStack *stack, JsonLexContext *lex)
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
errmsg
(
"invalid input syntax for type json:
\"
%s
\"
"
,
errmsg
(
"invalid input syntax for type json:
\"
%s
\"
"
,
lex
->
input
),
lex
->
input
),
detail
?
errdetail
_internal
(
detail
,
lex
->
line_number
,
token
)
:
0
));
detail
?
errdetail
(
detail
,
lex
->
line_number
,
token
)
:
0
));
}
}
/*
/*
...
@@ -658,7 +658,7 @@ report_invalid_token(JsonLexContext *lex)
...
@@ -658,7 +658,7 @@ report_invalid_token(JsonLexContext *lex)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
errmsg
(
"invalid input syntax for type json"
),
errmsg
(
"invalid input syntax for type json"
),
errdetail
_internal
(
"line %d: Token
\"
%s
\"
is invalid."
,
errdetail
(
"line %d: Token
\"
%s
\"
is invalid."
,
lex
->
line_number
,
token
)));
lex
->
line_number
,
token
)));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment