Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message for outputs with zero width or height, or better default #33

Open
byorgey opened this issue Sep 23, 2013 · 0 comments

Comments

@byorgey
Copy link
Member

byorgey commented Sep 23, 2013

If one attempts to render an output with a height or width of zero, currently one simply gets an error like user error (error while writing to output stream). For example, given Test.hs containing

import           Diagrams.Backend.Cairo.CmdLine
import           Diagrams.Prelude

main = defaultMain (hrule 1)

we obtain the following:

$ ghc --make Test && ./Test -w 100 -o Test.png
[1 of 1] Compiling Main             ( Test.hs, Test.o )
Linking Test ...
Test: user error (error while writing to output stream)

Note that we only specify a width on the command line; if we specify an explicit height it works fine.

We should at the very least generate a nice error message; or perhaps we could replace a height of 0 by the width, and vice versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant