reddcoin-project / reddcoin-3.10

Reddcoin: the digital social currency
http://www.reddcoin.com
MIT License
287 stars 114 forks source link

Daemon startup error handling #19

Closed samvaughton closed 9 years ago

samvaughton commented 10 years ago

Whilst integrating 1.3 into the reddwallet, I came across the rebuild blockchain bug.. When receiving this error from the daemon child process (stderr) I get this:

Error opening block database.\n\nDo you want to rebuild the block database now? > \nreddcoind-linux-32: db/version_set.cc:803: leveldb::VersionSet::~VersionSet(): > Assertion `dummyversions.next_ == &dummyversions' failed.\n

Considering there could be other errors etc, this is a hard way to parse a daemon error message. Perhaps change this into a JSON format or atleast provide a decodable message in the string such as

[error:0001]

Where the number indicates what type of error with a code list. Preferably JSON though eg:

{
    "error": true, 
    "message": "Error opening block database", 
    "code": 0001
}

Thoughts?

MathyV commented 10 years ago

I don't agree that there should be JSON on the stderr. Perhaps we can make it available through an RPC call but that depends on where in the startup process we are.

Also, this is a result of an assert and shouldn't even happen in release mode, I'll have to look at what is going on here in more detail first.

samvaughton commented 10 years ago

I don't mind the implementation just need be able to accurately identify the error and display an appropriate message if the daemon doesn't get far enough for RPC.

Sam Vaughton

On 31 July 2014 13:00, Mathy Vanvoorden notifications@github.com wrote:

I don't agree that there should be JSON on the stderr. Perhaps we can make it available through an RPC call but that depends on where in the startup process we are.

Also, this is a result of an assert and shouldn't even happen in release mode, I'll have to look at what is going on here in more detail first.

— Reply to this email directly or view it on GitHub https://github.com/reddcoin-project/reddcoin/issues/19#issuecomment-50749104 .

MathyV commented 10 years ago

Don't work on this until bigmerge is done

laudney commented 10 years ago

Can you just display this message in whole if it appears?

samvaughton commented 10 years ago

Yeah, most of it isn't very user friendly but I can try and do that for now.