Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add Error Handling for invalid lost syntax #180
Comments
|
Thanks for all your help Peter! |
|
I'm taking a look a this again–filtering out anything that isn't valid shouldn't be too hard–the only issue is that I'm not sure what would be the best way to handle the error. It could:
After a quick glance–I'm not sure if anything is in place to handle any errors with lost. Thoughts? |
|
I prefer 3 as well. :) |
|
I'll see what it would take to wire that up. You currently don't have any error handling in lost, right? I'm not missing it? |
|
I suppose if there isn't, I should probably tackle error handling before tackling filtering and then throwing that error. |
|
Yeah I haven't added any err handling |
|
From @wyze Sorry about the delay here. I cleared the notification and forgot to get back to it! Testing is simple, just need to check if postcss throws when you pass something not valid. The tests seem basic as I created a method to wrap a majority of the testing since we were just comparing input to output. Here is a test I added to test/lost-utility.js: it('throws when not valid value', function() {
}); My gist of the full test/lost-utility.js is here: https://gist.github.com/wyze/7f240bcd6deb985ec776 |
|
I'm closing the #193 PR as I need to redo the branch (with the repo transfer) and want to investigate a larger error handling thought process. |
This morning I accidentally typed
lost-column: edit;instead oflost-utility: edit;. I'd love to see lost filter out params that it doesn't care about and do nothing instead of adding rules likewidth: calc(99.99% * edit - (30px - 30px * edit));along with the other rules that coexist when this is outputted.Throwing an error would be best.
The accomplish this error handling will need to be added.