File tree Expand file tree Collapse file tree 2 files changed +27
-27
lines changed Expand file tree Collapse file tree 2 files changed +27
-27
lines changed Original file line number Diff line number Diff line change @@ -201,33 +201,6 @@ bool CryptoErrorStore::Empty() const {
201201 return errors_.empty ();
202202}
203203
204- template <typename ... Args>
205- void CryptoErrorStore::Insert (const NodeCryptoError error, Args&&... args) {
206- const char * error_string;
207- switch (error) {
208- case NodeCryptoError::CIPHER_JOB_FAILED:
209- error_string = " Cipher job failed" ;
210- break ;
211- case NodeCryptoError::DERIVING_BITS_FAILED:
212- error_string = " Deriving bits failed" ;
213- break ;
214- case NodeCryptoError::ENGINE_NOT_FOUND:
215- error_string = " Engine \" %s\" was not found" ;
216- break ;
217- case NodeCryptoError::INVALID_KEY_TYPE:
218- error_string = " Invalid key type" ;
219- break ;
220- case NodeCryptoError::KEY_GENERATION_JOB_FAILED:
221- error_string = " Key generation failed" ;
222- break ;
223- case NodeCryptoError::NO_ERROR:
224- error_string = " No error" ;
225- break ;
226- }
227- errors.emplace_back (SPrintF (error_string,
228- std::forward<Args>(args)...));
229- }
230-
231204MaybeLocal<Value> CryptoErrorStore::ToException (
232205 Environment* env,
233206 Local<String> exception_string) const {
Original file line number Diff line number Diff line change @@ -186,6 +186,33 @@ struct CryptoErrorStore {
186186 std::vector<std::string> errors_;
187187};
188188
189+ template <typename ... Args>
190+ void CryptoErrorStore::Insert (const NodeCryptoError error, Args&&... args) {
191+ const char * error_string;
192+ switch (error) {
193+ case NodeCryptoError::CIPHER_JOB_FAILED:
194+ error_string = " Cipher job failed" ;
195+ break ;
196+ case NodeCryptoError::DERIVING_BITS_FAILED:
197+ error_string = " Deriving bits failed" ;
198+ break ;
199+ case NodeCryptoError::ENGINE_NOT_FOUND:
200+ error_string = " Engine \" %s\" was not found" ;
201+ break ;
202+ case NodeCryptoError::INVALID_KEY_TYPE:
203+ error_string = " Invalid key type" ;
204+ break ;
205+ case NodeCryptoError::KEY_GENERATION_JOB_FAILED:
206+ error_string = " Key generation failed" ;
207+ break ;
208+ case NodeCryptoError::NO_ERROR:
209+ error_string = " No error" ;
210+ break ;
211+ }
212+ errors_.emplace_back (SPrintF (error_string,
213+ std::forward<Args>(args)...));
214+ }
215+
189216template <typename T>
190217T* MallocOpenSSL (size_t count) {
191218 void * mem = OPENSSL_malloc (MultiplyWithOverflowCheck (count, sizeof (T)));
You can’t perform that action at this time.
0 commit comments