Open nicutor opened 6 years ago
Hi @nicutor. This looks like a bug. I'm guessing the return code of the method is lost and not being passed correctly.
After a quick look I think the issue is here: https://github.com/niieani/bash-oo-framework/blob/master/lib/util/type.sh#L435
It seems to be falling back to a boolean too eagerly after a > 0
status code.
But I haven't touched these parts in a while so I might be wrong.
Sadly, I don't have the time to debug this further at this point.
Hi @niieani . Thank you for your reply.
I am so sorry that there can't be a quick fix for that, as I was so decided to use this framework for my things. But now.. if the main thing (exception) is not working, I am not so sure that I will start to write all my new scripts using it. And for sure, after I will write them, I will not have time to rewrite them again when the framework will be fixed.. All my plans was ruined :(
Its really a good work, congrats for it.
Sorry to hear that, @nicutor. :( I wish the reality was different, but this is a free time project for me.
I will add a mark in the README to hold off major work based on the framework before we do a proper rewrite with 3.0 (#45).
There is no problem, I can totally understand you and I really appreciate your work! I am just annoyed that I found such a good library and I am not able to use it because of some small bugs.. :( But this is it :)
Sure thing! I wrote this more as an experiment a few years ago and the framework exploded just recently after somebody posted it this year to HackerNews (seriously, 3400 stars in a few days...!).
I don't think it's ready for serious projects (mainly due to missing test coverage, which could have find out about errors such as this one), so I've now added a disclaimer saying so.
I searched this bug by using git bisect
.
But... I don't think I got a valid result, because the left commit was def7373 , which just adds docs and renames some variables(etc).
So I guess that this bug was there from really early stage of this framework.
It means, I think @niieani 's this comment could be where bug is living:
After a quick look I think the issue is here: https://github.com/niieani/bash-oo-framework/blob/master/lib/util/type.sh#L435
It seems to be falling back to a boolean too eagerly after a > 0 status code.
It seems to be difficult to solve this :( Fortunately, I'm a student and have some free time. So I can work for this problem!!! I'll try to figure out/fix this bug ( after more code-reading)
Amazing, thanks @Cj-bc, I really appreciate this. If you need any insights on the code, feel free to ask questions here, or we can chat.
Hi,
I have this test script with 4 ways to execute mkdir command (for example):
1. Run mkdir command without class
Output:
2. Run mkdir command without class with try and catch
Output:
3. Run mkdir command using the Test class
Output:
4. Run mkdir command using the Test class with try and catch
Output:
The problem is that, the exception/error is not cought when I am using the Test Class. Is there something I need to set/import/etc. ? I am missing something?
Please guide me in the right direction.
Thank you!