Skip to content

Add checkUrl before NewWindow #47

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

Merged
merged 3 commits into from
Feb 16, 2015

Conversation

francisbouvier
Copy link

Signed-off-by: Francis Bouvier francis.bouvier@xerus-technologies.fr

Francis Bouvier added 2 commits February 16, 2015 10:52
Signed-off-by: Francis Bouvier <francis.bouvier@xerus-technologies.fr>
@francisbouvier
Copy link
Author

Hi @miketheprogrammer ,

A small PR in order to perform a quick check on the url parameter of the NewWindow function.

If the url scheme is empty this helper try to load the file from current directory.
So you can do:

thrust.NewWindow("index.html", nil)

If there is an error nothing happens as I don't know how you want to handle errors: panic or return error to the developer and let him handle it.

if u.Scheme == "" {
p, err := filepath.Abs(s)
if err != nil {
return p, err
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you return the result of the failing call, but a few lines up you return the argument to the failing call. Why the difference?

@francisbouvier
Copy link
Author

@cbandy

You're right, it makes more sense to return the argument of the failing call.

miketheprogrammer added a commit that referenced this pull request Feb 16, 2015
Add checkUrl before NewWindow
@miketheprogrammer miketheprogrammer merged commit 35b8560 into miketheprogrammer:master Feb 16, 2015
@francisbouvier
Copy link
Author

@miketheprogrammer
Thanks and congrats.

Unfortunately I have too few experience in C or C++ to help with Thrust core, but I will be happy to be part of the discussion regarding the direction of the project.
I can help with the bindings in Python, Go and Javascript.

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

Successfully merging this pull request may close these issues.

3 participants