PartKeepr icon indicating copy to clipboard operation
PartKeepr copied to clipboard

Show errors from Octopart search

Open sibbi77 opened this issue 3 years ago • 7 comments

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.

sibbi77 avatar Mar 28 '21 18:03 sibbi77

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.

codecov-io avatar Mar 28 '21 18:03 codecov-io

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

m4v avatar Jul 26 '21 18:07 m4v

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 avatar Jul 29 '21 20:07 sibbi77

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

ely-az avatar Oct 12 '21 23:10 ely-az

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.

Fivefold avatar Jan 09 '22 12:01 Fivefold

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

ucmelectronics avatar Mar 09 '22 17:03 ucmelectronics

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?

GillesF08 avatar Mar 23 '22 13:03 GillesF08