Extract exception and add define for max size.