Coder Social home page Coder Social logo

docraptor-php's People

Contributors

alexoverbeck avatar davidronk avatar esquivalient avatar jamespaden avatar janxious avatar jason-o-matic avatar jqr avatar mediocretes avatar peter279k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docraptor-php's Issues

Javascript error in page causes generic "Error connecting to the API" message

Hello,
I'm working on setting up Docraptor, and kept getting the following error:

AN ERROR OCCURRED DURING EXECUTION; PLEASE TRY AGAIN LATER.
ADDITIONAL INFORMATION:
DOCRAPTOR\APIEXCEPTION
File:
[...]/vendor/docraptor/docraptor/lib/ApiClient.php:249
Message:
[422] Error connecting to the API (https://docraptor.com//docs)

Eventually I figured out that it wasn't an actual connection error, and discovered that debug mode could output to a file. Once I turned that on, I found the following in the debug response:

[DEBUG] HTTP Response body ~BEGIN~
<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>[Javascript Error] ReferenceError: Can't find variable: L</error>
  <error>[Javascript Error] document:642</error>
</errors>

~END~

So, it turns out that Docraptor could connect to the API, it was just running into some JS errors on my page. It would be very helpful if these errors were reported in the exception that gets thrown, instead of throwing a generic "error connecting to the API" message.

Add binary corruption test

It's easy for generated clients to return accidentally utf8 encoded data, which ends up corrupting PDF/XLS/XLSX files. Let's add a test to ensure this can never happen.

Organize tests

If possile, it should use the PHPUnit to organize the tests.
If approved, let me do this.

Thanks.

ignore_console_messages is included on every request

ignore_console_messages, which defaults to true as of Pipeline 7, is included on every PHP request as false. This causes console messages to unexpectedly fail documents. My expectation would be that ignore_console_messages isn't included in the request unless explicitly defined.

As a workaround, ignore_console_messages can simply be set to true.

Typo prince_optinos

A few of the examples mistakenly write $prince_options instead of $prince_options.

Users should get SSL verification errors

Some PHP installations don't have root CAs included, so a default configuration of the PHP package won't work because under the hood curl fails to verify DocRaptor's cert.

This will show up in the apache logs:

SSL certificate problem: unable to get local issuer certificate

Unfortunately the exception that is raised is:

Uncaught exception 'DocRaptor\ApiException' with message 'API call to https://docraptor.com//docs timed out

which is misleading.

We might be able to bundle the necessary certs with the package to solve this.

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.