Skip to content

error message for size() #746

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

Closed
shiffman opened this issue Jun 13, 2015 · 4 comments
Closed

error message for size() #746

shiffman opened this issue Jun 13, 2015 · 4 comments

Comments

@shiffman
Copy link
Member

I believe there are several issues related to friendly error messages like #717 and #657, however, I couldn't find the right place for this. Someone feel free to move and close if a new issue isn't appropriate.

I was teaching a short workshop yesterday for some students who knew Processing. I ran the following code:

function setup() {
  size(200, 200);
}

function draw() {
  background(0);
}

And showed them the message: Uncaught size() not implemented, see createCanvas(). No one was able to guess what this meant, I propose changing it to something a bit more explicit? I'm terrible at writing these, but something along the lines of size() is not a valid p5 function, to create a drawing window please use createCanvas() instead.

@workergnome
Copy link
Contributor

I think that would be very helpful. Some more documentation on how to use the friendly error handling would be great—it's a fantastic tool, but I also am not 100% sure how to work with it. @crecord or @crhallberg, is there a place where people like myself could learn more about how to use it?

Thanks!

@workergnome
Copy link
Contributor

Looking into this a little bit—is there any reason why we don't just make size() function call the createCanvas() function? We could still throw a depreciated method note in there, but it seems pretty obvious what the user is intending...

Apologies if this was already discussed somewhere earlier.

@lmccart
Copy link
Member

lmccart commented Jul 18, 2015

@OhJia are you still interested in working on this one?

@OhJia
Copy link
Contributor

OhJia commented Jul 22, 2015

@lmccart updated error message and sent PR

@OhJia OhJia closed this as completed Jul 22, 2015
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

4 participants