Giter Club home page Giter Club logo

Comments (5)

thegengen avatar thegengen commented on June 23, 2024

Hmm, there's plenty of things that could be going on here. Let's see:

  • Do you see any print jobs in Google CloudPrint's console?
  • Do you see your printer in Google CloudPrint's console.
  • If you select your printer in the console and click 'Details', does it say "Printer is online and ready to print"
  • In that same screen, can you click 'Advanced' and paste the contents of the page here?

from cloudprint.

ChristianBoehlke avatar ChristianBoehlke commented on June 23, 2024

Thank you a lot for all the work on that library! :)

In case of an error, the response from the Google API that we get looks like this (as documented here: https://developers.google.com/cloud-print/docs/appInterfaces):

{
  "success": false,
  "request": {...},
  "errorCode": 403,
  "message": "Could not convert to PDF."
}

However, the print() method only returns nil unless the response has a job property. This makes it very hard for us to figure out what was going wrong and to display a helpful error message to the user. This is probably also related to #18.

Would it be possible that the print() method returns a more specific error? I would be happy to work on this.

from cloudprint.

thegengen avatar thegengen commented on June 23, 2024

Hi. I'm not sure without looking into the details. Unfortunately, I won't be able to look into this until the middle of next week. In the meantime, if you could share a sanitized version of your content, that could prove very useful.

Next, I'll get back to you with my findings. Sorry for the delay.

from cloudprint.

thegengen avatar thegengen commented on June 23, 2024

Sorry for the delay @ChristianBoehlke, had a look and I understand what you mean by this now. So the way I see it, there are a few ways to go about this:

  • We introduce some kind of PrintResult class which has a job and an error (or array of errors)
  • We raise an exception when printing fails and we let people rescue and handle it however they wish.
  • We create print! to raise an exception, like the Rails stuff typically does.

I'm inclined to raise when print is called and not introduce another method. Either way this is a breaking change, and I'll be sure to add it to the ChangeLog and the README. But I feel like people upgrading and getting exceptions for code that fails to print is the best of all outcomes here.

Let me know what you think. I should have the code for this ready tomorrow or on Saturday.

from cloudprint.

thegengen avatar thegengen commented on June 23, 2024

@ChristianBoehlke there is a branch for this now: print-exceptions.

Would you mind taking it for a spin and seeing if everything's OK?

from cloudprint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.