Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-tink
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-tink
Commits
7ab19fb2
Commit
7ab19fb2
authored
5 years ago
by
przydatek
Committed by
Copybara-Service
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Internal change.
PiperOrigin-RevId: 258360247
parent
1702ba49
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/util/clif.cc
+10
-13
10 additions, 13 deletions
python/util/clif.cc
with
10 additions
and
13 deletions
python/util/clif.cc
+
10
−
13
View file @
7ab19fb2
...
...
@@ -16,13 +16,10 @@
#include
"tink/python/util/clif.h"
#include
"google/protobuf/message_set.pb.h"
#include
"absl/strings/str_cat.h"
#include
"tink/util/canonical_errors.h"
#include
"tink/util/status.h"
#if !defined(PORTABLE_STATUS)
#include
"tink/util/status_payload.h"
#endif
namespace
crypto
{
namespace
tink
{
...
...
@@ -69,29 +66,29 @@ Status StatusFromPyException() {
}
if
(
PyErr_ExceptionMatches
(
PyExc_MemoryError
))
{
return
::
util
::
ResourceExhaustedError
(
PyExcFetch
());
return
Status
(
util
::
error
::
RESOURCE_EXHAUSTED
,
PyExcFetch
());
}
if
(
PyErr_ExceptionMatches
(
PyExc_NotImplementedError
))
{
return
::
util
::
UnimplementedError
(
PyExcFetch
());
return
Status
(
util
::
error
::
UNIMPLEMENTED
,
PyExcFetch
());
}
if
(
PyErr_ExceptionMatches
(
PyExc_KeyboardInterrupt
))
{
return
::
util
::
AbortedError
(
PyExcFetch
());
return
Status
(
util
::
error
::
ABORTED
,
PyExcFetch
());
}
if
(
PyErr_ExceptionMatches
(
PyExc_SystemError
)
||
PyErr_ExceptionMatches
(
PyExc_SyntaxError
))
{
return
::
util
::
InternalError
(
PyExcFetch
());
return
Status
(
util
::
error
::
INTERNAL
,
PyExcFetch
());
}
if
(
PyErr_ExceptionMatches
(
PyExc_TypeError
))
{
return
::
util
::
InvalidArgumentError
(
PyExcFetch
());
return
Status
(
util
::
error
::
INVALID_ARGUMENT
,
PyExcFetch
());
}
if
(
PyErr_ExceptionMatches
(
PyExc_ValueError
))
{
return
::
util
::
OutOfRangeError
(
PyExcFetch
());
return
Status
(
util
::
error
::
OUT_OF_RANGE
,
PyExcFetch
());
}
if
(
PyErr_ExceptionMatches
(
PyExc_LookupError
))
{
return
::
util
::
NotFoundError
(
PyExcFetch
());
return
Status
(
util
::
error
::
NOT_FOUND
,
PyExcFetch
());
}
return
::
util
::
UnknownError
(
PyExcFetch
());
return
Status
(
util
::
error
::
UNKNOWN
,
PyExcFetch
());
}
PyObject
*
Clif_PyObjFrom
(
const
Status
&
c
,
const
clif
::
py
::
PostConv
&
unused
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment