jegonzal / PowerGraph

PowerGraph: A framework for large-scale machine learning and graph computation.
344 stars 518 forks source link

Fix: catch exceptions by reference #190

Open lqhl opened 8 years ago

lqhl commented 8 years ago

When I type a wrong option in command line, boost::po fails to replace the %canonical_option% tag. For example, PowerGraph should output

Invalid syntax:
         unrecognised option '--threshold'

Instead, it outputs

Invalid syntax:
         unrecognised option %canonical_option%

The reason is that if we don't catch exceptions by reference, we get 'object slicing' which is explained here.