ObjFW  Diff

Differences From Artifact [65b9bf22dd]:

To Artifact [015ac7b5d3]:


16
17
18
19
20
21
22

23
24
25
26
27
28
29

#include <sys/types.h>

#import "OFObject.h"

@class OFString;
@class OFURL;


/**
 * \brief An exception indicating an object could not be allocated.
 *
 * This exception is preallocated, as if there's no memory, no exception can
 * be allocated of course. That's why you shouldn't and even can't deallocate
 * it.







>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

#include <sys/types.h>

#import "OFObject.h"

@class OFString;
@class OFURL;
@class OFHTTPRequest;

/**
 * \brief An exception indicating an object could not be allocated.
 *
 * This exception is preallocated, as if there's no memory, no exception can
 * be allocated of course. That's why you shouldn't and even can't deallocate
 * it.
1281
1282
1283
1284
1285
1286
1287





















































	    URL: (OFURL*)url;

/**
 * \return The URL whose protocol is unsupported
 */
- (OFURL*)URL;
@end




























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
	    URL: (OFURL*)url;

/**
 * \return The URL whose protocol is unsupported
 */
- (OFURL*)URL;
@end

/**
 * \brief An exception indicating that the server sent an invalid reply.
 */
@interface OFInvalidServerReplyException: OFException
@end

/**
 * \brief An exception indicating that a HTTP request failed.
 */
@interface OFHTTPRequestFailedException: OFException
{
	OFHTTPRequest *HTTPRequest;
	short statusCode;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, nonatomic) OFHTTPRequest *HTTPRequest;
@property (readonly) short statusCode;
#endif

/**
 * \param class_ The class of the object which caused the exception
 * \param request The HTTP request which failed
 * \param code The status code of the fialed HTTP request
 * \return A new HTTP request failed exception
 */
+ newWithClass: (Class)class_
   HTTPRequest: (OFHTTPRequest*)request
     statusCode: (short)code;

/**
 * Initializes an already allocated HTTP request failed exception
 *
 * \param class_ The class of the object which caused the exception
 * \param request The HTTP request which failed
 * \param code The status code of the fialed HTTP request
 * \return A new HTTP request failed exception
 */
- initWithClass: (Class)class_
    HTTPRequest: (OFHTTPRequest*)request
     statusCode: (short)code;

/**
 * \return The HTTP request which failed
 */
- (OFHTTPRequest*)HTTPRequest;

/**
 * \return The status code of the HTTP request
 */
- (short)statusCode;
@end