Title: Preventing error display
Last modified: November 29, 2021

---

# Preventing error display

 *  [Adam Romanowski](https://wordpress.org/support/users/adamromanowski/)
 * (@adamromanowski)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/preventing-error-display/)
 * Hey,
 * First of all, thank you for the awesome plugin.
 * My issue is error messages being displayed even with `WP_DEBUG = false;`. In 
   my project’s case it makes sense that the map can be empty or not (programmatically
   placing shortcode in some places).
 * I mean the `.osm_error_msg` ones like this:
 * > [OSM-Plugin-Error]:CustomField: OSM_geo_data
 * Is there any extra constant that I can define to avoid it?
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [MiKa](https://wordpress.org/support/users/photoweblog/)
 * (@photoweblog)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/preventing-error-display/#post-15113079)
 * Hello [@adamromanowski](https://wordpress.org/support/users/adamromanowski/)
 * no, this should simply not be shown!
    Contact us here: [https://wp-osm-plugin.hyumika.com/contact/](https://wp-osm-plugin.hyumika.com/contact/)
   with: * the link to the site the shows the error * the WP OSM Plugin shortcode
   you use on this site.
 * Or post it here.
 * Br, Michael
    -  This reply was modified 4 years, 6 months ago by [MiKa](https://wordpress.org/support/users/photoweblog/).
    -  This reply was modified 4 years, 6 months ago by [MiKa](https://wordpress.org/support/users/photoweblog/).
 *  Thread Starter [Adam Romanowski](https://wordpress.org/support/users/adamromanowski/)
 * (@adamromanowski)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/preventing-error-display/#post-15113180)
 * Thank you for such a quick response. Unfortunately, I cannot share an URL, but
   I’ll try to be as specific as possible without it.
 * Here’s a shot of a page:
    [https://share.getcloudapp.com/7KuAwYkv](https://share.getcloudapp.com/7KuAwYkv)(
   error on top of content)
 * Here’s HTML of the same page:
    [https://share.getcloudapp.com/7KuAwYjv](https://share.getcloudapp.com/7KuAwYjv)
 * Here is the state of constants (from Xdebug; tried with just WP_DEBUG_DISPLAY
   disabled as well as with WP_DEBUG):
    [https://share.getcloudapp.com/4guPL6Pg](https://share.getcloudapp.com/4guPL6Pg)
   [https://share.getcloudapp.com/JrunQKnD](https://share.getcloudapp.com/JrunQKnD)
 * Here’s the example shortcode:
 *     ```
       	[osm_map_v3  tagged_type="ntl_place" map_center="43.7586,6.9242" zoom="1" width="100%" height="850" tagged_filter_type="ntl_place_category" tagged_filter="Jan Kolwaski" marker_name="mic_black_pinother_02.png" type="stamen_watercolor" map_border="none" tagged_color="black" ]
       ```
   
 * Note, I know that there’s nothing in the taxonomy term, so I expect not pointers.
   Want to avoid errors though 🙂
 * Interestingly when I try to save post with the same shortcode, it won’t even 
   save. The HTML goes to the top of the returned value of the fetched response:
   
   [https://share.getcloudapp.com/4guPL6Wv](https://share.getcloudapp.com/4guPL6Wv)
 *  Plugin Author [MiKa](https://wordpress.org/support/users/photoweblog/)
 * (@photoweblog)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/preventing-error-display/#post-15113366)
 * Hello [@adamromanowski](https://wordpress.org/support/users/adamromanowski/)
 *  thanks for the details.
    You are right, if there are no locations, the map with“
   all locations” fails with an error, since there are no locations to show. That
   was never a problem up to now, apparently nobody ever tried or needed it. The
   clear solution would be show an empty map … I will have a look to it in the next
   version (around December).
 * Thank you and br, Michael
 * PS: Not a good idea at all(!) … but if you want to, for any reason: Osm_TraceLevel
 *  Thread Starter [Adam Romanowski](https://wordpress.org/support/users/adamromanowski/)
 * (@adamromanowski)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/preventing-error-display/#post-15113412)
 * Thanks Michael,
 * I guess we approached the usage of the plugin quite creatively 🙂
 * For now I’ ll just run another query to not run shortcode if no places to show,
   but I think hiding all errors based on standard WP constants would be great.
 * Thanks again for your awesome work.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Preventing error display’ is closed to new replies.

 * ![](https://ps.w.org/osm/assets/icon-256x256.png?rev=2087144)
 * [OSM - OpenStreetMap](https://wordpress.org/plugins/osm/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/osm/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/osm/)
 * [Active Topics](https://wordpress.org/support/plugin/osm/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/osm/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/osm/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Adam Romanowski](https://wordpress.org/support/users/adamromanowski/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/preventing-error-display/#post-15113412)
 * Status: not resolved