Commit graph

7 commits

Author SHA1 Message Date
John C. Vernaleo b0ca6d5903 Fix typo in comment. 2013-08-15 10:15:25 -04:00
Dave Collins 10542e0573 Optimize and improve credential stripping code.
Since we already have the specific username and password we want to strip
from errors, use a specific search string rather than a generic regular
expression.  This is quite a bit more efficient than using regular
expressions and also has the benefit of being more accurate.

Also, rather than using the added overhead of fmt to convert the error to
a string, just call Error() directly on it to get the string.

Finally, instead of just stripping it, replace it with the literal
string "<username>:<password>" to avoid any possible confusion in the
error messages where it might otherwise appear the url was being
constructed incorrectly.

ok jcv@
2013-06-14 11:32:50 -05:00
John C. Vernaleo 2a475d7299 Need to test for nil before regex. 2013-06-14 11:47:09 -04:00
John C. Vernaleo e4a80edc95 Clean the error message on connect failure so username and password is not shown. 2013-06-14 11:32:05 -04:00
AndreasM 27b69ccca3 unhide error message from jsonRpcSend 2013-06-13 19:16:41 +03:00
John C. Vernaleo 2fc8982be5 Add tests for MarshallAndSend function. 2013-05-15 10:08:05 -04:00
John C. Vernaleo d0d58c54db Initial implementation. 2013-05-13 12:25:41 -04:00