Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: base/nss_init.cc

Issue 71009: Report what went wrong when initializing NSS_NoDB_Init. (Closed)
Patch Set: Fixes for deanm Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/nss_init.cc
diff --git a/base/nss_init.cc b/base/nss_init.cc
index c0114b79c4ccd2e478576fd000bb3f464093c946..911ff35927532ac22bf218c83ac61ca8fc7914fc 100644
--- a/base/nss_init.cc
+++ b/base/nss_init.cc
@@ -6,6 +6,7 @@
#include <nss.h>
#include <plarena.h>
+#include <prerror.h>
#include <prinit.h>
// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=455424
@@ -40,9 +41,16 @@ SECMODModule *InitDefaultRootCerts() {
class NSSInitSingleton {
public:
NSSInitSingleton() {
-
// Initialize without using a persistant database (e.g. ~/.netscape)
- CHECK(NSS_NoDB_Init(".") == SECSuccess);
+ SECStatus status = NSS_NoDB_Init(".");
+ if (status != SECSuccess) {
+ char buffer[513] = "Couldn't retrieve error";
+ PRInt32 err_length = PR_GetErrorTextLength();
+ if (err_length > 0 && size_t(err_length) < sizeof(buffer))
+ PR_GetErrorText(buffer);
+
+ NOTREACHED() << "Error calling NSS_NoDB_Init: " << buffer;
+ }
root_ = InitDefaultRootCerts();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698