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

Show errors from Octopart search #1206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sibbi77
Copy link
Contributor

@sibbi77 sibbi77 commented Mar 28, 2021

Currently errors are only shown if no results are returned, but Octopart returns results (empty ones).
This "fixes" #1178 and #1203, because now the error message mentions the user should upgrade to the PRO account (which is free).
Even the PRO account cannot retrieve cad data. Disabled.

@codecov-io
Copy link

codecov-io commented Mar 28, 2021

Codecov Report

Merging #1206 (d5a0b64) into master (c6323d5) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1206   +/-   ##
=========================================
  Coverage     36.87%   36.87%           
  Complexity     1803     1803           
=========================================
  Files           258      258           
  Lines          5763     5763           
=========================================
  Hits           2125     2125           
  Misses         3638     3638           
Impacted Files Coverage Δ Complexity Δ
...tKeepr/OctoPartBundle/Services/OctoPartService.php 0.00% <ø> (ø) 7.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6323d5...d5a0b64. Read the comment docs.

@m4v
Copy link

m4v commented Jul 26, 2021

I tried this patch hoping that it would help with #1222 but now I get an "PartKeepr cannot access the Octopart API" error message.

@sibbi77
Copy link
Contributor Author

sibbi77 commented Jul 29, 2021

Make sure you are actually using the patch (remove all caches and redeploy all javascript). I just rebuilt PartKeepr and it is working with a Pro Free account.

@ely-az
Copy link

ely-az commented Oct 12, 2021

Thank you! This worked for me. I made the code changes manually and they took effect immediately without having to rerun setup.

@Fivefold
Copy link

Fivefold commented Jan 9, 2022

Make sure you are actually using the patch (remove all caches and redeploy all javascript). I just rebuilt PartKeepr and it is working with a Pro Free account.

@sibbi77 How do I do this?

I set up a fresh dockerized setup as described in the docs. Like @m4v I initially got the "You are not authorized to access 'cad'" error from #1222. Once I implement your patch I get a "PartKeepr cannot access the Octopart API" error message upon opening the Octopart search.

Rerunning PartKeepr setup, restarting or recreating the docker containers don't fix the issue.

I do see API calls on my Octopart Pro Free account get used up, so there does seem to be a successful connection.

@ucmelectronics
Copy link

Perfect. Modified in the indicated directions, everything works correctly. Octopart working 100%.

@GillesF08
Copy link

I set up a fresh dockerized setup as described in the docs. Like @m4v I initially got the "You are not authorized to access 'cad'" error from #1222. Once I implement your patch I get a "PartKeepr cannot access the Octopart API" error message upon opening the Octopart search.

Rerunning PartKeepr setup, restarting or recreating the docker containers don't fix the issue.

I do see API calls on my Octopart Pro Free account get used up, so there does seem to be a successful connection.

I observed exactly the same behavior: the query works and Octopart is replying properly but PHP is throwing an error/warning:
error line 53 in src/PartKeepr/OctoPartBundle/Controller/DefaultController.php
Consequently, the Json_decode() fails as the response is not anymore a valid JSON (contains PHP error report).

I solved this by modifying PHP configuration: /usr/local/etc/php/php.ini
and changing:
display_errors = On
into
display_errors = stderr
Then restarted the container

I did not dig more to determine what the PHP error/warning is but masking the error reporting allows retrieving Octopart reply and importing the data into PartKeepr.

Maybe it would be good to change the docker image to disable PHP error display?

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.

7 participants