Index: src/XMPPJID.m ================================================================== --- src/XMPPJID.m +++ src/XMPPJID.m @@ -19,15 +19,14 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#include - #include #import "XMPPJID.h" +#import "XMPPExceptions.h" @implementation XMPPJID @synthesize node; @synthesize domain; @synthesize resource; @@ -80,14 +79,15 @@ node = nil; return; } if ((rc = stringprep_profile([node_ cString], &nodepart, - "Nodeprep", 0)) != STRINGPREP_OK) { - of_log(@"Nodeprep failed: %s", stringprep_strerror(rc)); - assert(0); - } + "Nodeprep", 0)) != STRINGPREP_OK) + @throw [XMPPStringPrepFailedException newWithClass: isa + connection: nil + profile: @"Nodeprep" + string: node_]; @try { node = [[OFString alloc] initWithCString: nodepart]; } @finally { free(nodepart); @@ -101,14 +101,15 @@ OFString *old = domain; char *srv; Stringprep_rc rc; if ((rc = stringprep_profile([domain_ cString], &srv, - "Nameprep", 0)) != STRINGPREP_OK) { - of_log(@"Nameprep failed: %s", stringprep_strerror(rc)); - assert(0); - } + "Nameprep", 0)) != STRINGPREP_OK) + @throw [XMPPStringPrepFailedException newWithClass: isa + connection: nil + profile: @"Nameprep" + string: domain_]; @try { domain = [[OFString alloc] initWithCString: srv]; } @finally { free(srv); @@ -128,14 +129,16 @@ resource = nil; return; } if ((rc = stringprep_profile([resource_ cString], &res, - "Resourceprep", 0)) != STRINGPREP_OK) { - of_log(@"Resourceprep failed: %s", stringprep_strerror(rc)); - assert(0); - } + "Resourceprep", 0)) != STRINGPREP_OK) + @throw [XMPPStringPrepFailedException + newWithClass: isa + connection: nil + profile: @"Resourceprep" + string: resource_]; @try { resource = [[OFString alloc] initWithCString: res]; } @finally { free(res);