Error on import - More graceful error needed

9 years 1 month ago #260798 by MarylandShallIssue
Error on import - More graceful error needed was created by MarylandShallIssue
I wanted to let you all know of an error that occurs when importing subscriptions into CB Subs. I was able to figure out the issue but thought you might want to present a more graceful error message when failing on this condition to help your membership who created the same error that I did find it quicker without turning to support.

I was testing out the import feature and inadvertently used a non-existent plan ID in the import CSV. Here's the error message when I try to reproduce it:

Fatal error: Call to a member function get() on a non-object in /home/maryland/public_html/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/models/misc/cbpaidSubscriptionsImporter.php on line 333

The original error message was on line 349 as well. Changing to a valid plan ID fixed the issue but the error message wasn't very helpful at the time. I only figured it out by noticing the plan IDs in the MySQL table holding plans.

Seems if the plan doesn't exist than the get() member function will throw an exception at runtime. Not sure how you'd catch that other than maybe checking the plan ID's against all valid plan IDs first and then running through your compatibility logic.

Please Log in to join the conversation.

9 years 1 month ago #260838 by krileon
Replied by krileon on topic Error on import - More graceful error needed
It builds an invalid object (or not one at all) when that happens, which causes that error. We'll be improving the error reporting and its usage in a later release.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.611 seconds

Facebook Twitter LinkedIn